B3D help
Blitz3D Forums/Blitz3D Beginners Area/B3D help
| ||
Hi, I've used various free terrain making programs featured in the Toolbox section, but they make B3D files. How do I load a terrain as a B3D file, because I've tried using LoadMesh with the file the terrain generator makes, but nothing appears on the screen when the program runs. I haven't been able to find any tutorials on reading B3D files and displaying them in the game, and when I ran a search on B3D in the forums, I couldn't find any threads about this. Help please ! |
| ||
LoadMesh() should work fine with a .b3d file. Make sure that you update Blitz3d with the latest update. Early versions did not support the .b3d format. Updating to the latest version should ensure that you can load .b3d files. Make sure that the textures used are in the same folder as the model. Make sure that you have positioned the camera in a place where the terrain will be visible. Is the camera inside the mesh ? If you are looking at the terrain from below you will not see anything because the mesh normals are facing away from you. Check your scales - maybe the model is too small. |
| ||
Try this:graphics3d 1024, 768, 32, 1 setbuffer backbuffer() ;This is just for the Freelook() function Global campitch#,camyaw#,mvx#,mvy#,mvz#,temp#,vx#,vy#,vz# terrain = loadmesh("terrain.b3d") moveentity terrain, 0, -2, 3 light = createlight() camera = createcamera() while not keyhit(1) freelook(camera) UpdateWorld() renderworld() Flip wend Function freelook(camera) mxspd#=MouseXSpeed()*0.25 myspd#=MouseYSpeed()*0.25 MoveMouse GraphicsWidth()/2,GraphicsHeight()/2 campitch=campitch+myspd If campitch<-85 Then campitch=-85 If campitch>85 Then campitch=85 RotateEntity camera,campitch,EntityYaw(camera)-mxspd,0 ;If KeyDown(203) Then mvx=mvx-.3 ;If KeyDown(205) Then mvx=mvx+.3 ;If KeyDown(200) Then mvz=mvz+.3 ;If KeyDown(208) Then mvz=mvz-.3 If KeyDown(30) Then mvx=mvx-.3 If KeyDown(32) Then mvx=mvx+.3 If KeyDown(17) Then mvz=mvz+.3 If KeyDown(31) Then mvz=mvz-.3 mvx#=mvx*.8 mvy#=mvy*.8 mvz#=mvz*.8 MoveEntity camera,mvx,mvy,mvz End Function |
| ||
Thanks guys! Sorted it out :) |