Object disappear when moving

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
giulioz
Posts: 8
Joined: Mon Jun 24, 2013 2:21 pm

Object disappear when moving

Post by giulioz »

I want to import a 3d model from a SCO file (Big Rigs - Over the road racing) using a custom importer.
I wrote a code that loads the vertices, the indices and the texture coordinates from the file and fills up a MeshBuffer.
I can render the model but when I move the camera from (0, 0,0) the object disappears.

Even with

Code: Select all

camera.FarValue = 9999999999;
camera.NearValue = 0.001f;
buffer.RecalculateBoundingBox();
mesh.RecalculateBoundingBox();
sceneNode.SetMaterialFlag(MaterialFlag.BackFaceCulling, false);
camera.AutomaticCulling = CullingType.Off;
Can someone help me? Thanks in advance :)
kklouzal
Posts: 343
Joined: Sun Mar 28, 2010 8:14 pm
Location: USA - Arizona

Re: Object disappear when moving

Post by kklouzal »

Possibly the camera is not facing the node anymore?
Dream Big Or Go Home.
Help Me Help You.
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Re: Object disappear when moving

Post by Seven »

Possible check. Set node debug info to see bounding box then draw line from camera position to either node position or just down camera target vector to be sure what you are looking at?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Object disappear when moving

Post by CuteAlien »

Test if culling is responsible by disabling it for you node with setAutomaticCulling(irr::scene::EAC_OFF).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Object disappear when moving

Post by hybrid »

You probably forgot to set the bounding boxes, both for mesh buffers and the mesh itself. This leads to these problems.
Post Reply