Hi,
i'm trying to create a landscape as it is described in
http://wiki.truevision3d.com/tutorialsarticlesandexamples/vehicle_starter_kit.
My code looks like this:
initTextures
| path |
path := 'C:\3D\Vehicle\vehiclestarterkit intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit\bin\Debug\Textures\'.
texturefactory loadTexture: (path , 'grass.jpg') sTextureName: 'Grass' iWidth: -1 iHeight: -1 eColorKey: 0 bFilterAndStretch: true.
texturefactory loadTexture: (path , 'skyup.jpg') sTextureName: 'SkyTop' iWidth: -1 iHeight: -1 eColorKey: 0 bFilterAndStretch: true.
texturefactory loadTexture: (path , 'skydown.jpg') sTextureName: 'SkyBottom' iWidth: -1 iHeight: -1 eColorKey: 0 bFilterAndStretch: true.
texturefactory loadTexture: (path , 'skyleft.jpg') sTextureName: 'SkyLeft' iWidth: -1 iHeight: -1 eColorKey: 0 bFilterAndStretch: true.
texturefactory loadTexture: (path , 'skyright.jpg') sTextureName: 'SkyRight' iWidth: -1 iHeight: -1 eColorKey: 0 bFilterAndStretch: true.
texturefactory loadTexture: (path , 'skyfront.jpg') sTextureName: 'SkyFront' iWidth: -1 iHeight: -1 eColorKey: 0 bFilterAndStretch: true.
texturefactory loadTexture: (path , 'skyback.jpg') sTextureName: 'SkyBack' iWidth: -1 iHeight: -1 eColorKey: 0 bFilterAndStretch: true.
initLandscape
| twidth theight path |
path := 'C:\3D\Vehicle\vehiclestarterkit intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit\bin\Debug\Heightmaps\'.
land := scene createLandscape: 'Land'.
land setAffineLevel: (TV3D65Constants at: #TV_AFFINE_LOW).
twidth := (64 * 8) / 256.
theight := (64 * 8) / 256.
land generateTerrain: (path , 'heightmap.bmp')
ePrecision: (TV3D65Constants at: #TV_PRECISION_HIGH)
iWidth: twidth
iHeight: theight
fPosX: 0.0
fPosY: 0.0
fPosZ: 0.0
bSmoothTerrain: true.
land setTexture: (globals getTex: 'Grass').
land setMaterial: matLand.
land setTextureScale: 10.0 fTvScale: 10.0.
land setPosition: (((twidth * 256) / 2) negated) y: 0 z: (((theight * 256) / 2) negated).
gameLoop
[bDoLoop]
whileTrue: [
self checkInput.
tv clear: false.
atmosphere skyBox_Render.
land render.
scene finalizeShadows.
self drawInterface.
tv renderToScreen.
].
09-29-2008 08:39:36 | --------------------------------------------
09-29-2008 08:39:36 | Truevision3D Debug/Log File
09-29-2008 08:39:36 | --------------------------------------------
09-29-2008 08:39:36 | Engine Version : 6.5
09-29-2008 08:39:36 | ENGINE INFO : DLL Compilation time Sep 3 2007 13:13:18
09-29-2008 08:39:36 | DEVICE INIT : Initialize Depth
09-29-2008 08:39:36 | DEVICE INIT : Using Antialiasing with 2 samples
09-29-2008 08:39:36 | DEVICE INIT : Initializing the device in windowed mode, with a render surface size of 1098x822, format 22, depthbuffer 75
09-29-2008 08:39:37 | VIEWPORT MANAGER : Main viewport initialization
09-29-2008 08:39:37 | VIEWPORT MANAGER : Main viewport initialized (1098x822)
09-29-2008 08:39:37 | DEVICE INIT : Initialization successful !
09-29-2008 08:39:37 | DEVICE INFO : 3D Card : NVIDIA GeForce 8400 GS (Omega 1.169.25) | Card ID : 1058 | Driver ID : 727821
09-29-2008 08:39:37 | DEVICE INFO : Available texture memory : 1002 MB
09-29-2008 08:39:37 | DEVICE INFO : Vertex Shaders 3.0 supported in hardware.
09-29-2008 08:39:37 | Debug info : vs fffe0300 ps ffff0300
09-29-2008 08:39:37 | DEVICE INFO : Pixel Shaders 3.0 supported in hardware.
09-29-2008 08:39:37 | DEVICE INFO : Driver used is a DirectX9-level driver 'nvd3dum.dll'. Excellent
09-29-2008 08:39:37 | DEVICE INFO : Card Type Geforce6xxx/7xxx/8xxx/ATIRadeonX1xxx Level card, third generation of programmable card
09-29-2008 08:39:37 | VIEWPORT MANAGER ERROR : Viewport_Create : the hwnd 1050632 is already used for the viewport 0. Specify another hwnd (control or form) if you want to create a new viewport.
09-29-2008 08:39:37 | TEXTURE MANAGER : Loading of 'C:\3D\Vehicle\vehiclestarterkit intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit\bin\Debug\Textures\grass.jpg' successful 'Grass' on index 2
09-29-2008 08:39:37 | TEXTURE MANAGER : Loading of 'C:\3D\Vehicle\vehiclestarterkit intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit\bin\Debug\Textures\skyup.jpg' successful 'SkyTop' on index 3
09-29-2008 08:39:37 | TEXTURE MANAGER : Loading of 'C:\3D\Vehicle\vehiclestarterkit intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit\bin\Debug\Textures\skydown.jpg' successful 'SkyBottom' on index 4
09-29-2008 08:39:37 | TEXTURE MANAGER : Loading of 'C:\3D\Vehicle\vehiclestarterkit intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit\bin\Debug\Textures\skyleft.jpg' successful 'SkyLeft' on index 5
09-29-2008 08:39:37 | TEXTURE MANAGER : Loading of 'C:\3D\Vehicle\vehiclestarterkit intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit\bin\Debug\Textures\skyright.jpg' successful 'SkyRight' on index 6
09-29-2008 08:39:37 | TEXTURE MANAGER : Loading of 'C:\3D\Vehicle\vehiclestarterkit intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit\bin\Debug\Textures\skyfront.jpg' successful 'SkyFront' on index 7
09-29-2008 08:39:37 | TEXTURE MANAGER : Loading of 'C:\3D\Vehicle\vehiclestarterkit intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit\bin\Debug\Textures\skyback.jpg' successful 'SkyBack' on index 8
09-29-2008 08:39:37 | LANDSCAPE : Landscape object #0 has been initialized
09-29-2008 08:39:37 | LANDSCAPE : Generating landscape #0 from heightmap C:\3D\Vehicle\vehiclestarterkit intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit Intro\VehicleStarterKit\bin\Debug\Heightmaps\heightmap.bmp
09-29-2008 08:39:37 | LANDSCAPE : 2x2 Landscape successfully generated with 4356 vertices and 26136 indices in 78 milliseconds.
09-29-2008 08:39:37 | LANDSCAPE : Quadtree created for the landscape in 0 milliseconds.
09-29-2008 08:39:42 | START UNLOAD
09-29-2008 08:39:42 | RESSOURCE MANAGER : Engine successfully unloaded
When I start it, a "floating point error: InvalidOperation" occurs.
TV3D65ITVLandscape>>Render raises this error but I can't figure out why.
I've tried createEmptyTerrain as well but it doesn't work too.
I'm thankful for any helping hand.
Thanks