Re: [osg-users] Dark Side of The Moon
Insert another MatrixTransform between your arrow and the AutoTransform to point it the way you want it. -Paul _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Renan Mendes Sent: Saturday, April 05, 2008 7:31 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Dark Side of The Moon Hi, Paul. Thanks for the tip about the AutoTransform. I'm not being able though to initialize the object I'm attaching to this node in the expected position... It's a 3D mouse arrow, composed of a cone and a cylinder at the bottom - very simple. When I do the following: this-setPosition(osg::Vec3f(-3/sqrt(2.0)*ALTCONE/4, 0.0, -3/sqrt(2.0)*ALTCONE/4)); this-setRotation(rot); // rot is a certain quaternion the arrow starts in the right position, when the camera is at its home position (looking at the direction of the positive y-axis). But when I add: this-setAutoRotateMode(ROTATE_TO_SCREEN); it's like the two other commands are ignored, and the arrow always appears as being looked from the top. What should I do? Thanks again, Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Dark Side of The Moon
Hi, Paul. I've done what you've told me. I've made some tests which led me into thinking one thing, which I'd like you to correct me if I'm wrong and give me some further explanations: when I select ROTATE_TO_SCREEN, it looks like the image chosen as 'front' - the side displayed on the screen - is the one seen from the z-axis. What I have to do is to rotate my shape initially so that I have the side I want, looking at that direction. Is that right? Thanks, Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Dark Side of The Moon
I'm not sure whether AutoTransform ROTATE_TO_SCREEN faces the positive or negative z axis, but yes you understand correctly: The MatrixTransform you add will have to do the right rotation so that AutoTransform keeps the side you want facing the viewer. -Paul _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Renan Mendes Sent: Sunday, April 06, 2008 11:34 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Dark Side of The Moon Hi, Paul. I've done what you've told me. I've made some tests which led me into thinking one thing, which I'd like you to correct me if I'm wrong and give me some further explanations: when I select ROTATE_TO_SCREEN, it looks like the image chosen as 'front' - the side displayed on the screen - is the one seen from the z-axis. What I have to do is to rotate my shape initially so that I have the side I want, looking at that direction. Is that right? Thanks, Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Dark Side of The Moon
Thanks, Paul, for everything. Renan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Dark Side of The Moon
Hi, I'm trying to do a dark-side-of-the-moon effect (nothing to do with Pink Floyd), i.e., I'm trying to have the same view of a certain object independently of how my camera is oriented, never showing it's 'dark side'. I thought of updating this object with some variation or component of my view matrix, but I don't know exactly what it is. Can anyone shed some light on this question? Thanks! Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Dark Side of The Moon
This is what the AutoTransform node is for. -Paul _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Renan Mendes Sent: Saturday, April 05, 2008 9:01 AM To: OSG Mailing List Subject: [osg-users] Dark Side of The Moon Hi, I'm trying to do a dark-side-of-the-moon effect (nothing to do with Pink Floyd), i.e., I'm trying to have the same view of a certain object independently of how my camera is oriented, never showing it's 'dark side'. I thought of updating this object with some variation or component of my view matrix, but I don't know exactly what it is. Can anyone shed some light on this question? Thanks! Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Dark Side of The Moon
Hi, Paul. Thanks for the tip about the AutoTransform. I'm not being able though to initialize the object I'm attaching to this node in the expected position... It's a 3D mouse arrow, composed of a cone and a cylinder at the bottom - very simple. When I do the following: this-setPosition(osg::Vec3f(-3/sqrt(2.0)*ALTCONE/4, 0.0, -3/sqrt(2.0)*ALTCONE/4)); this-setRotation(rot); // rot is a certain quaternion the arrow starts in the right position, when the camera is at its home position (looking at the direction of the positive y-axis). But when I add: this-setAutoRotateMode(ROTATE_TO_SCREEN); it's like the two other commands are ignored, and the arrow always appears as being looked from the top. What should I do? Thanks again, Renan M Z Mendes ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org