Page 1 of 1

[SOLVED] Mesh disappears...

Posted: Wed Mar 04, 2009 11:41 pm
by Linaxys
Hello,
When I move on my floor and rotate at some angles, it disappears sunddenly...

I don't really know where it could come from, maybe my graphics card (Intel GMA 950) under OpenGL, here's the video : http://www.youtube.com/watch?v=VkR92r7sFh0

Here's the code I am using :

Code: Select all

SMesh *mesh = new SMesh();
mesh->addMeshBuffer(new SMeshBuffer());
SMeshBuffer* mb = reinterpret_cast<SMeshBuffer*>(mesh->getMeshBuffer(mesh->getMeshBufferCount()-1));

mb->Vertices.push_back(video::S3DVertex(-10, 0, 10, 0, 0, -1, color, 0, 0));
mb->Vertices.push_back(video::S3DVertex(10, 0, 10, 0, 0, -1, color, 1, 0));
mb->Vertices.push_back(video::S3DVertex(10, 0, -10, 0, 0, -1, color, 1, 1));
mb->Vertices.push_back(video::S3DVertex(-10, 0, -10, 0, 0, -1, color, 0, 1));

mb->Indices.push_back(0);
mb->Indices.push_back(1);
mb->Indices.push_back(2);
mb->Indices.push_back(0);
mb->Indices.push_back(2);
mb->Indices.push_back(3);

mb->Indices.push_back(3);
mb->Indices.push_back(2);
mb->Indices.push_back(1);
mb->Indices.push_back(3);
mb->Indices.push_back(1);
mb->Indices.push_back(0);

mesh->recalculateBoundingBox();
return (IMesh*)mesh;
It never does that on a similiar DAE model made with Google Sketchup and Blender.

Thanks.

Posted: Wed Mar 04, 2009 11:47 pm
by Steel Style
Hi I think that not really your node problem that you seeing here but the culling one but I may wrong. Anyway did you tried to extend your bounding box a little to disable this effect.

Posted: Wed Mar 04, 2009 11:49 pm
by Linaxys
Err I've never tried to extend the bouding box, how should I do that ?
Because I don't really see how much I would have to extend it...

Thanks for your reply.

--

EDIT: Oh yes, it looks like working, do I have to set it to the double of it's size ? What happens if the bouding box is too high ?

Posted: Thu Mar 05, 2009 12:00 am
by Linaxys
Hmm yeah, I debugged it, and recalculateBoundingBox doesn't seem to work, it always returns 1,1,1 instead of 10,0,10...

Is there another way to get the highest vertex to get the bounding boxes ?

Thanks.

Posted: Thu Mar 05, 2009 12:50 am
by Munger
As a quick and dirty fix (with the emphasis on 'dirty'), you can disable culling per node using ISceneNode.setAutomaticCulling(EAC_OFF).

http://irrlicht.sourceforge.net/docu/cl ... d2db28c5b8

Posted: Thu Mar 05, 2009 2:26 am
by bitplane
You have to call recalculateBoundingBox on the mesh buffer and then on the mesh. Recalculating the mesh bbox just updates it from the mesh buffers.

Posted: Thu Mar 05, 2009 5:01 am
by vitek
It could also be caused by this problem.

Travis

Posted: Thu Mar 05, 2009 6:30 am
by Linaxys
bitplane wrote:You have to call recalculateBoundingBox on the mesh buffer and then on the mesh. Recalculating the mesh bbox just updates it from the mesh buffers.
Thank you guys, it solved my problem !