Hello,

Wünsch wrote:
> HI Muhammad and all,
> 
> If have a similar problem. It seems that some tools that generate vrml files 
> save the vertex data with respect not to the local coordinate system of a 
> Geometry but with respect to the world coordinate system.

in that case the local coordinate system should coincide with the world 
coordinate system, otherwise something seems wrong. It is possible that 
transformations are folded into the vertex data, but then they should 
also be removed from the scene (otherwise they are applied twice).

Undoing this basically requires determining the transformation (the 
tricky part, unless you are only interested in translation), applying 
its inverse to the vertices and storing it in a transform node above the 
model.

> I guess one needs to somehow compute the "center of mass" or local geometric 
> center of the vertices and then change the vertices such that they are stored 
> with respect to that local center and additionally store the offset "world to 
> local center" in the preceding Component Transformation.
 >
> Is there a function to calculate the center of mass or the center of an array 
> of Vertices? I guess one has to consider in the indices somehow in that 
> algorith, too.

I don't think there is a function to compute the center of mass, but
often the center of the bounding volume gives a good approximation and 
is far easier to compute ;)
If you really want to do something like this you, I don't think you need 
to look at the indices as you more interested in the "corners" of your 
geometry, therefore it should not matter how many faces meet at one vertex.

        Hope it helps,
                Carsten

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to