[SOLVED] Mesh disappears...

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Linaxys
Posts: 47
Joined: Tue Feb 24, 2009 10:46 pm

[SOLVED] Mesh disappears...

Post 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.
Last edited by Linaxys on Thu Mar 05, 2009 6:31 am, edited 1 time in total.
Steel Style
Posts: 168
Joined: Sun Feb 04, 2007 3:30 pm
Location: France

Post 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.
Linaxys
Posts: 47
Joined: Tue Feb 24, 2009 10:46 pm

Post 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 ?
Linaxys
Posts: 47
Joined: Tue Feb 24, 2009 10:46 pm

Post 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.
Munger
Posts: 28
Joined: Sun Mar 04, 2007 11:39 am
Location: Tokyo

Post 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
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post 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.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

It could also be caused by this problem.

Travis
Linaxys
Posts: 47
Joined: Tue Feb 24, 2009 10:46 pm

Post 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 !
Post Reply