Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Maybe a bug ??  (Read 3505 times)
hexawar
Community Member
*
Posts: 2


« on: December 19, 2011, 05:21:27 AM »

Hi,

I try to use Truevision3D with windev.

I use the .NET engine ( who is the most compatible and easy to use )

But i have a error when i try to make the Snow exemple. all is working expect the Land :

My code is like this

Scene       is a TVScene()
Land       is a TVLandscape() 

Land = Scene.CreateLandscape("Landscape")

And i have an error one the last line : Incompatible types(chaps) during an affectation(appointment).

Scene.createlandscape make a TVLandscape ?? So i do not know where is the error ?

Or maybe Windev do not understand the .NET correctly

Thx

Olivier

PS : Excuse my english !!
Logged
SylvainTV
Administrator
Community Member
*****
Posts: 4971


WWW
« Reply #1 on: December 19, 2011, 05:37:47 PM »

Well nobody ever tested the engine with WinDev I think. Their .NET implementation is maybe a little weird.

And yes CreateLandscape make a TVLandscape, so should be ok.

Make sure that you created the Scene before (new it, not just declare it).
In VB6, you had to use "Set Land = Scene.CreateLandscape("Landscape")"
Maybe in this lang you must also use "Set".

Maybe post the entire code so that we can check that too?
« Last Edit: December 19, 2011, 05:48:42 PM by SylvainTV » Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
hexawar
Community Member
*
Posts: 2


« Reply #2 on: December 21, 2011, 04:37:32 AM »

Thanx, i found

I must use : Land <- Scene.CreateLandscape("Landscape") and not
Land = Scene.CreateLandscape("Landscape") it's like the Set

Here the full code if some one interessed :

GLOBAL
engine       is TVEngine()
Scene       is TVScene()
Camera       is TVCamera()
Texture    is TVTextureFactory()
Lights       is TVLightEngine()
Materials    is TVMaterialFactory()
Land       is TVLandscape()     

LOCAL
   
   nNumHandle is int
   bDoLoop is boolean
   clCouleur is TV_COLOR()
   clTV_3DVECTOR is TV_3DVECTOR()
   
   
   Mat is int
   
   
nNumHandle = Handle(FEN_Snow)

engine.AllowMultithreading(True)
engine.SetDebugMode(True, True)
engine.SetDebugFile(fExeDir()+"\debugfile.txt")
engine.Init3DWindowed(nNumHandle, True)
engine.DisplayFPS(True)
engine.SetAngleSystem(MTV3D65.CONST_TV_ANGLE.TV_ANGLE_DEGREE)

Scene.SetRenderMode(CONST_TV_RENDERMODE.TV_SOLID)
clCouleur.r = 0.2
clCouleur.g = 0.2
clCouleur.b = 0.2
clCouleur.a = 0.5
Scene.SetShadowParameters(clCouleur.GetIntColor(),False)

light is int
Lights.SetGlobalAmbient(0, 0, 0)
clTV_3DVECTOR.x = 0
clTV_3DVECTOR.y = 0
clTV_3DVECTOR.z = 0
light = Lights.CreatePointLight(clTV_3DVECTOR, 0.5, 0.5, 0.5, 0.5, "", 1)
Lights.SetLightAttenuation(light, 0.00, 0.0045778662, 0.0)
Lights.SetLightRange(light, 100)
Lights.SetLightPosition(light, 90, 1, 90)

Camera.SetCamera(50, 50, 50, 90, 10, 90);
Camera.SetViewFrustum(45, 10000);

Land <- Scene.CreateLandscape("Landscape")
Land.CreateEmptyTerrain(CONST_TV_LANDSCAPE_PRECISION.TV_PRECISION_BEST, 8, 8, 0, 0, 0)
Land.SetAffineLevel(CONST_TV_LANDSCAPE_AFFINE.TV_AFFINE_HIGH)
Land.EnableLOD(True)
Land.SetTexture(Texture.LoadTexture(fExeDir()+"\snow.bmp"))
Land.SetTextureScale(5, 5)
Land.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_MANAGED)
Mat = Materials.CreateMaterial("LandMat")
Materials.SetAmbient(Mat, 0, 0, 0, 1.0)
Materials.SetDiffuse(Mat, 0.5, 0.5, 0.5, 1)
Materials.SetEmissive(Mat, 0, 0, 0, 0)
Materials.SetOpacity(Mat, 1.0)
Land.SetMaterial(Mat)


atmosphere is TVAtmosphere
atmosphere.Fog_SetColor(0.75,0.75,0.75)
atmosphere.Fog_SetType(CONST_TV_FOG.TV_FOG_LINEAR,CONST_TV_FOGTYPE.TV_FOGTYPE_VERTEX)
atmosphere.Fog_SetParameters(30,400,0.1)
atmosphere.Fog_Enable(True)
atmosphere.Rain_Init(100,Texture.LoadAlphaTexture(fExeDir()+"\snowpar.bmp",""),0.5,0,-2,0.52,140,0.2)
atmosphere.Rain_Enable(True)


Scene.SetBackgroundColor(0, 0, 0)


bDoLoop = True;

nind is int

WHILE bDoLoop = True
   engine.Clear(True)
   Land.Render()
   atmosphere.Rain_Render()
   atmosphere.Atmosphere_Render()
   Scene.RenderAll(True)
   Scene.FinalizeShadows()
   engine.RenderToScreen()
    
   IF KeyPressed(VK_ESCAPE) THEN
      bDoLoop = False
   END
   Multitask(-1)
END

EndProgram()

All code is on a windows who work with windev ( for size, re size , open , close ... )

Olivier
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks