Bad Scaling - resulting in no lighting and missing polygons

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
jack_1313
Posts: 13
Joined: Sat Jan 10, 2004 5:25 am
Location: Australia
Contact:

Bad Scaling - resulting in no lighting and missing polygons

Post by jack_1313 »

In attempting to scale an OctTreeSceneNode (textured 3ds) using setScale(core::vector3df(40,40,40)), the result is that many of the polygons are not rendered until the camera is very close and all previous lighting effects are mysteriously disabled. Is this a comon problem? If so, how is it fixed (I would rather scale the level on load as oposed to in my model editor or having to scale everthing else down)?
WarZone - A 2D Action Wargame
http://warzone2d.zapto.org
Homer
Posts: 58
Joined: Tue Nov 18, 2003 7:11 pm
Location: Germany

Post by Homer »

Hi, I have the same problem and I also prefer to scale my model on load, but the only solution I've found is to scale it in the model editor.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

I think the lighting problem is there, because normals are not normalized after scaling.

Try using IMeshManipulator::scaleMesh() (http://irrlicht.sourceforge.net/docu/cl ... or.html#a4). But beware: In the current version, it has a bug, causing bounding boxes ot the mesh not to be recalculated. I'll be fixed in next release.
SuryIIID_

setScale...

Post by SuryIIID_ »

Well the problem is that you are scaling the mesh after you generate the Octree..but this will not work properly as you see..

it would be nice to if we have IAnimatedMesh->setScale(core::vector3df(10,10,10)); , IMesh->setScale(core::vector3df(10,10,10)); or something to scale a mesh before we actually create a scene node from it..
jack_1313
Posts: 13
Joined: Sat Jan 10, 2004 5:25 am
Location: Australia
Contact:

Post by jack_1313 »

There also seems to be a problem when using setPosition() to move the level into the correct place - the entire mesh dissapears, but the collisions still read. Is there a way to recalculate the normals with a function call ,or will I need to add this myself? It is slightly difficult when dealing with a mesh that you cannot move or scale. When do you expect the next version to arrive (Niko)?
WarZone - A 2D Action Wargame
http://warzone2d.zapto.org
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Most of the problems are fixed in the next version: The Meshmanipulator will handle all this, like recalculating normals and boundingboxes correctly.
jack_1313
Posts: 13
Joined: Sat Jan 10, 2004 5:25 am
Location: Australia
Contact:

Post by jack_1313 »

When do you expect the next version to be released (or is this information which you do not wish to expose so as that you are not facing deadlines?)?
WarZone - A 2D Action Wargame
http://warzone2d.zapto.org
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

I don't know yet, sorry. :)
Post Reply