Mesh just disappearsBlitz3D Forums/Blitz3D Bug Reports/Mesh just disappears
| Hi there, I have created a random city generator. It's essentially one mesh that is created using blitz commands and pushes 65300 odd vertices in the one mesh. The problem is, and it happens VERY rarely, the entire mesh just disappears. The camera hasn't moved position, the mesh just disappears.|
Is there any reason for this to happen? I do realise Blitz3D is getting on a bit now, and these kind of bugs that creep in are expected. Just wondering if anyone has encountered this? Is very difficult to test, due to the infrequency of it occuring. I would post my code, but my main loop consists of some basic camera movement code and update and renderworld:
While Not KeyHit(1) Cls If KeyDown(208) Then MoveEntity camera,0,-1,0 If KeyDown(200) Then MoveEntity camera,0,1,0 If KeyDown(203) Then MoveEntity camera,-1,0,0 If KeyDown(205) Then MoveEntity camera,1,0,0 If MouseDown(1) Then MoveEntity camera,0,0,1 If MouseDown(2) Then MoveEntity camera,0,0,-1 RotateEntity camera,EntityPitch(camera,True)+(MouseYSpeed()*0.2),EntityYaw(camera,True)+(MouseXSpeed()*-0.2),0 MoveMouse 400,300 UpdateWorld RenderWorld Flip Wend End
| Couple of thoughts:|
- Might be an incorrectly-sized bounding-box volume, especially since you're procedurally generating this mesh.
- Might be the breaking of vertex amount. Try splitting the city into clusters that are children of the scene root - this requires them to be in a different mesh.
The box volume problem has happened to me before when dealing with skeletal animated meshes that traveled too far from their pivot point.
If this bounding box lies outside the camera's view frustum, even with the mesh's polygons in view, it gets hidden.
Try to use that hidden MeshCullBox command and set a humongous box volume for your city so it always stays in sight.
Last edited 1+ years ago