Rotation with "complex" axis problem in VRML

View: New views
2 Messages — Rating Filter:   Alert me  

Rotation with "complex" axis problem in VRML

by Eric Cazeaux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I don't know if it's the correct mailing list but anyway. I found a
strange behavior of the parser when parsing rotation axis in VRML in
some cases.

/Transform
{
   rotation 0.55735 0.55735 0.55735 1.571
    children []
}
/
Looking forward, I found that the axis for the rotation is currently
initialized like this (in /Vrml97Parser.cpp line 3536/) :
/
x = floatValue();
y = floatValue();
z = floatValue();
angle = floatValue();

r.x(x);
r.y(y);
r.z(z);
r.angle(angle);/


The problem is that for each call of r.x(), r.y(),r.z(), the axis is
renormalized. So, I think it should be fixed using this new code :
/
x = floatValue();
y = floatValue();
z = floatValue();
angle = floatValue();

r.axis(vec3f(x,y,z).normalize());
r.angle(angle);/

At the same time, we save 2 normalizations!
Let me know if I'am right or not and you will be able to fixe it.

Regards,

Eric

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
openvrml-develop mailing list
openvrml-develop@...
https://lists.sourceforge.net/lists/listinfo/openvrml-develop

Re: Rotation with "complex" axis problem in VRML

by Braden McDaniel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eric Cazeaux wrote:
> I don't know if it's the correct mailing list but anyway.

[snip]

It is.

> The problem is that for each call of r.x(), r.y(),r.z(), the axis is
> renormalized. So, I think it should be fixed using this new code :

[snip]

> At the same time, we save 2 normalizations!
> Let me know if I'am right or not and you will be able to fixe it.

You are right. However, this code has been completely replaced in
OpenVRML 0.17. The current parsing code doesn't do any normalization.
See openvrml::rotation_parser<>::operator() in vrml97_grammar.h.

--
Braden McDaniel                      e-mail: <braden@...>
<http://endoframe.com>               Jabber: <braden@...>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
openvrml-develop mailing list
openvrml-develop@...
https://lists.sourceforge.net/lists/listinfo/openvrml-develop
LightInTheBox - Buy quality products at wholesale price