I believe I've come across a fault in Transform::computeBound() which can lead to vertices not being contained by their bounding sphere
 
I'll demonstrate by example :
 
I create a sphere centred at [0,0,0] with radius 1. It encloses a vertex at [0.577, 0.577, 0.577].
 
I apply the matrix:
[1.333, 0.333, 0.333, 0]
[0.333, 1.333, 0.333, 0]
[0.333, 0.333, 1.333, 0]
[0,       0,       0,        1]
 
(the matrix is a scaling by 2 in the direction of [1, 1, 1])
 
computeBound() will transform the vertices { [1, 0, 0], [0, 1, 0], [0, 0, 1] } by the matrix, resulting in { [1.333, 0.333, 0.333], [0.333, 1.333, 0.333], [0.333, 0.333, 1.333] }
The lengths of each of these transformed vertices is 1.414, therefore the new bounding sphere will be assigned a radius of 1.414.
 
Meanwhile, our vertex at [0.577, 0.577, 0.577] after being transformed will become [1.154, 1.154, 1.154], which has a length of 2 and is therefore not contained by the new bounding sphere!
 
In practical terms this means that we may see objects suddenly popping into view as the camera turns towards them!
 
 
I believe that to solve this we need a way to determine the direction of maximal scaling, but unfortunately my matrix skills don't stretch that far.
Can someone solve this?

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to