' We set the water height via a variable. We need this variable ' to be able to add an extra underwater fog effect later, at the ' rendering. sngWaterHeight = 100 * Land.SetWaterAltitude(sngWaterHeight)

' And we finish by enabling the water. * Land.SetWaterEnable(True)

' New : for fun, we will also add some clouds, just over the water ' to give a creepy fog effect. Let's start by loading the clouds textures. TextureFactory.LoadTexture("..\..\..\..\Media\clouds.dds", "Clouds", CONST_TV_COLORKEY.TV_COLORKEY_BLACK)

Crap! your right I have a two versions of this going, one started with the 6.2 tutorial and the other (this one) from 6.3 sourcecode. I have that in the other one and not this one, and I didn't even notice. Duh! Thanks!! I'll see if that fixes it and report my findings in this thread. later....

Logged

Using VB.NET, TV3D 6.5, Win 7~~~~~~~~~~~~~~~~~~~~~~~

"Know how to ask. There is nothing more difficult for some people, nor for others, easier."

' New : as said above, we need to create a new object which will ' hold all the textures needed for our land. TextureFactory = New TVTextureFactory

' New : the land generation. This is so much fun because it's ' so simple! You load a texture as a height map, the engine ' does the rest. But before this, we create the land object. Land = New TVLandscape

' New : the land generation. This is so much fun because it's ' so simple! You load a texture as a height map, the engine ' does the rest. But before this, we create the land object. 'Land = Scene.CreateLandscape("Landscape")

' Because we don't want to have mountains with height that get to ' the clouds, we adjust the height (Y) factor. 'Land.SetFactorY(0.7) Land.SetHeight(0, 7, 0)

' Then, we load the land texture. TextureFactory.LoadTexture("..\..\..\..\Media\dirtandgrass.jpg", "LandTexture")

' We assign a texture to that land. Land.SetTexture(Globals.GetTex("LandTexture")) Land.SetTextureScale(3, 3)

' New : the sun. We have to place the sun in the world. Just like the ' sky box, the sun is attached to the camera position vector. You will ' never notice it until you start playing really badly with the ' properties of the sun. Let's start by loading a texture for it. TextureFactory.LoadTexture("..\..\..\..\Media\sun.jpg", "Sun")

' New : To add extra visual effects, we add a lens flare effect. For ' this, we have to load some cirles that will be used to simulate ' the flare effect. TextureFactory.LoadTexture("..\..\..\..\Media\flare1.jpg", "Flare1") TextureFactory.LoadTexture("..\..\..\..\Media\flare2.jpg", "Flare2") TextureFactory.LoadTexture("..\..\..\..\Media\flare3.jpg", "Flare3") TextureFactory.LoadTexture("..\..\..\..\Media\flare4.jpg", "Flare4")

'Land.SetAffineLevel(CONST_TV_LANDSCAPE_AFFINE.TV_AFFINE_LOW) ' New : also for fun, we add animated water. We start by loading the ' water teture... TextureFactory.LoadTexture("..\..\..\..\Media\water.bmp", "Water")

' Then, we set everything we can for this water. 'Land.SetWaterTexture(TrueVision3DTVGlobals_definst.GetTex("Water")) 'Land.SetWaterEffect(False, 0.5, True, DxVBLibA.CONST_D3DBLEND.D3DBLEND_SRCALPHA, DxVBLibA.CONST_D3DBLEND.D3DBLEND_INVSRCALPHA, False) 'Land.SetWaterTextureScale(5)

' Then, we set everything we can for this water. Land.SetWaterTexture(Globals.GetTex("Water")) Land.SetWaterEffect(False, 0.5, True, CONST_TV_BLENDEX.TV_BLENDEX_SRCALPHA, CONST_TV_BLENDEX.TV_BLENDEX_INVSRCALPHA, False) Land.SetWaterTextureScale(5)

' We set the water height via a variable. We need this variable ' to be able to add an extra underwater fog effect later, at the ' rendering. sngWaterHeight = 100 Land.SetWaterAltitude(sngWaterHeight)

' And we finish by enabling the water. Land.SetWaterEnable(True)

' New : for fun, we will also add some clouds, just over the water ' to give a creepy fog effect. Let's start by loading the clouds textures. TextureFactory.LoadTexture("..\..\..\..\Media\clouds.dds", "Clouds", CONST_TV_COLORKEY.TV_COLORKEY_BLACK)

Well, I'm still stuck on this one and not happy with myself. Since I've not been able to post the code in a post because it's too long. I'll post a link to download a text file of it in a zip folder. Here it is If you see what I'm missing - same 8 errors as before! Let me know please.

Logged

Using VB.NET, TV3D 6.5, Win 7~~~~~~~~~~~~~~~~~~~~~~~

"Know how to ask. There is nothing more difficult for some people, nor for others, easier."

Thank you Ghost. I had forgotten about that set of samples from TV3DSamples. I've been using a 6.2 and a 6.3 version while working on these tutorials. I will read through the code and see if that will help. Thanks again! I think you just got me unstuck.....

Logged

Using VB.NET, TV3D 6.5, Win 7~~~~~~~~~~~~~~~~~~~~~~~

"Know how to ask. There is nothing more difficult for some people, nor for others, easier."

Okay some progress, but I seem to have a poor understanding of how to get the water plane to where it should be on the Landscape. I'll post the code (Below) that I think should be telling it where to go, but isn't placing it on the landscape. As you can see by the above picture.

Code:

' New : the land generation. This is so much fun because it's ' so simple! You load a texture as a height map, the engine ' does the rest. But before this, we create the land object. Land = Scene.CreateLandscape("Landscape")

Land.SetAffineLevel(CONST_TV_LANDSCAPE_AFFINE.TV_AFFINE_LOW)

' Generate the height of the land from the grayscale of the image. Land.GenerateTerrain("..\..\..\..\Media\heightmap.jpg", CONST_TV_LANDSCAPE_PRECISION.TV_PRECISION_LOW, 8, 8, -600, -1024, 0, True)

' Then, we load the land texture. TFactory.LoadTexture("..\..\..\..\Media\dirtandgrass.jpg", "LandTexture")

' We assign a texture to that land. Land.SetTexture(Globals.GetTex("LandTexture")) Land.SetTextureScale(3, 3)

' New : the sun. We have to place the sun in the world. Just like the ' sky box, the sun is attached to the camera position vector. You will ' never notice it until you start playing really badly with the ' properties of the sun. Let's start by loading a texture for it. TFactory.LoadTexture("..\..\..\..\Media\sun.jpg", "Sun")

' New : To add extra visual effects, we add a lens flare effect. For ' this, we have to load some cirles that will be used to simulate ' the flare effect. TFactory.LoadTexture("..\..\..\..\Media\flare1.jpg", "Flare1") TFactory.LoadTexture("..\..\..\..\Media\flare2.jpg", "Flare2") TFactory.LoadTexture("..\..\..\..\Media\flare3.jpg", "Flare3") TFactory.LoadTexture("..\..\..\..\Media\flare4.jpg", "Flare4")

' We set the water height via a variable. We need this variable ' to be able to add an extra underwater fog effect later, at the ' rendering. 'sngWaterHeight = 100 sngWaterHeight = -1 'Land.SetWaterAltitude(sngWaterHeight) WPlane.Dist = sngWaterHeight WPlane.Normal = Globals.Vector3(0, 1, 0) ' New : we create the graphic object so we can add some fog. GraphicFX = New TVGraphicEffect ' And we finish by enabling the water. 'Scene.SetWaterEnable(True) GraphicFX.SetWaterReflection(WaterMesh, ReflectRS, RefractRS, 0, WPlane) ' New : for fun, we will also add some clouds, just over the water ' to give a creepy fog effect. Let's start by loading the clouds textures. TFactory.LoadTexture("..\..\..\..\Media\clouds.dds", "Clouds", MTV3D65.CONST_TV_COLORKEY.TV_COLORKEY_BLACK)