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
|