Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / Scaling objects using world matrix in direct3d Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Cazzz

March 21, 2005, 04:33 AM

Hi all,

A friend and I make a basic scene graph system. As you may know the properties of a parent node in the graph are inherted in the child nodes.
This is also true for scaling. Since a mesh scaling (transposing all the vertices along their normals)would be bad for performance, we just alter the scale component of our 4x4 world matrix (M11, M22 and M33).
The scaling works; if the parent alters his scale, the childobjects scale.
Only wierd thing is the lighting. When we scale the parent up the light (wich is a directional light) becomes less bright and when we scale down we get over exposure. As seen on the image below.
We're working on a generic GPU from intel so it lacks HW transform&lighting.
We would like to know if this wierd behaviour can be changed?

http://www.mackatack.com/spectroubles.jpg

 
Gerald Knizia (cgk)

March 21, 2005, 06:37 AM

Yes, it can. pD3dDevice->SetRenderState( D3DRS_NORMALIZENORMALS, true ).
You might run into trouble anyway, because when normals are transformed using the world transformation matrix (instead of its inverted transpose), the normals will generally not be normal to the faces they belong to anymore. So you should consider using only Ortho/Uniform scaling transformations or writing a vertex shader to do it right in the first place.

 
This thread contains 2 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.