OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

How should I reset position/rotation/scale using


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
GMD GammerMaxyandex.ru
Guest





PostPosted: Wed Nov 05, 2008 5:47 am    Post subject:
How should I reset position/rotation/scale using
Reply with quote

Hi. I have question about MatrixTransform.
How should I reset position/rotation/scale using MatrixTransform?
Code:

{
osg::Matrix mat;
osg::Vec3d _Trans = MyMatrixTransform->getMatrix().getTrans();
osg::Quat _Rotate =MyMatrixTransform->getMatrix().getRotate();
osg::Vec3d _Scale = MyMatrixTransform->getMatrix().getScale();
MyMatrixTransform->setMatrix(osg::Matrix::scale(1.0f,1.0f,1.0f) *
osg::Matrix::rotate(0.0f,0.0f,0.0f,1.0f)*
osg::Matrix::translate(0.0f,0.0f,0.0f));
mat = osg::Matrix::scale(1.0f,1.0f,1.0f) * osg::Matrix::rotate(0.0f,0.0f,0.0f,1.0f) * osg::Matrix::translate(0.0f,0.0f,0.0f);
if (!scale) mat.preMult (osg::Matrix::scale(_Scale));
if (!rotate) mat.preMult (osg::Matrix::rotate(_Rotate));
if (!position) mat.preMult (osg::Matrix::translate(_Trans));
MyMatrixTransform->setMatrix (mat);
}


After that rotation ( MyMatrixTransform->getMatrix().preMult(osg::Matrix::rotate(angle3,osg::Vec3d(0,0,1))); )
depends from scale (when scale is 10.0, rotation (angle3 = 0.2) visually works like angle3=0).

How should I reset position/rotation/scale correctly?


------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Wed Nov 05, 2008 10:17 am    Post subject:
How should I reset position/rotation/scale using
Reply with quote

Hi ??? Please use the mailing list convention of signing with the name
you wish to be addressed with,

Might I recommend you use osg::PositionAttitudeTransform? This
manages the potioning, scaling, rotation and pivot point all as
separate variables so there is no need to try an decompose a Matrix
into its part and recombine.

Robert.

On Wed, Nov 5, 2008 at 5:47 AM, GMD GammerMaxyandex.ru
<> wrote:
Quote:
Hi. I have question about MatrixTransform.
How should I reset position/rotation/scale using MatrixTransform?
Code:

{
osg::Matrix mat;
osg::Vec3d _Trans = MyMatrixTransform->getMatrix().getTrans();
osg::Quat _Rotate =MyMatrixTransform->getMatrix().getRotate();
osg::Vec3d _Scale = MyMatrixTransform->getMatrix().getScale();
MyMatrixTransform->setMatrix(osg::Matrix::scale(1.0f,1.0f,1.0f) *
osg::Matrix::rotate(0.0f,0.0f,0.0f,1.0f)*
osg::Matrix::translate(0.0f,0.0f,0.0f));
mat = osg::Matrix::scale(1.0f,1.0f,1.0f) * osg::Matrix::rotate(0.0f,0.0f,0.0f,1.0f) * osg::Matrix::translate(0.0f,0.0f,0.0f);
if (!scale) mat.preMult (osg::Matrix::scale(_Scale));
if (!rotate) mat.preMult (osg::Matrix::rotate(_Rotate));
if (!position) mat.preMult (osg::Matrix::translate(_Trans));
MyMatrixTransform->setMatrix (mat);
}


After that rotation ( MyMatrixTransform->getMatrix().preMult(osg::Matrix::rotate(angle3,osg::Vec3d(0,0,1))); )
depends from scale (when scale is 10.0, rotation (angle3 = 0.2) visually works like angle3=0).

How should I reset position/rotation/scale correctly?




------------------
Post generated by Mail2Forum
Back to top
GMD GammerMaxyandex.ru
Guest





PostPosted: Wed Nov 05, 2008 12:50 pm    Post subject:
How should I reset position/rotation/scale using
Reply with quote

Thanks Robert,
PositionAttitudeTransform works as I nedded. But can I reset matrix transformation using MatrixTransform?

Robert, answer please, is there any paied technical support of OSG which can helps me do some things with OSG or give advices about how can I realize some of my ideas better? If there is some thing like this could you give me they contacts.

Thanks, Max.


05.11.08, 13:17, "Robert Osfield" <>:

Quote:
Hi ??? Please use the mailing list convention of signing with the name
you wish to be addressed with,
Might I recommend you use osg::PositionAttitudeTransform? This
manages the potioning, scaling, rotation and pivot point all as
separate variables so there is no need to try an decompose a Matrix
into its part and recombine.
Robert.
On Wed, Nov 5, 2008 at 5:47 AM, GMD GammerMaxyandex.ru
<> wrote:
Quote:
Hi. I have question about MatrixTransform.
How should I reset position/rotation/scale using MatrixTransform?
Code:

{
osg::Matrix mat;
osg::Vec3d _Trans = MyMatrixTransform->getMatrix().getTrans();
osg::Quat _Rotate =MyMatrixTransform->getMatrix().getRotate();
osg::Vec3d _Scale = MyMatrixTransform->getMatrix().getScale();
MyMatrixTransform->setMatrix(osg::Matrix::scale(1.0f,1.0f,1.0f) *
osg::Matrix::rotate(0.0f,0.0f,0.0f,1.0f)*
osg::Matrix::translate(0.0f,0.0f,0.0f));
mat = osg::Matrix::scale(1.0f,1.0f,1.0f) * osg::Matrix::rotate(0.0f,0.0f,0.0f,1.0f) * osg::Matrix::translate(0.0f,0.0f,0.0f);
if (!scale) mat.preMult (osg::Matrix::scale(_Scale));
if (!rotate) mat.preMult (osg::Matrix::rotate(_Rotate));
if (!position) mat.preMult (osg::Matrix::translate(_Trans));
MyMatrixTransform->setMatrix (mat);
}


After that rotation ( MyMatrixTransform->getMatrix().preMult(osg::Matrix::rotate(angle3,osg::Vec3d(0,0,1))); )
depends from scale (when scale is 10.0, rotation (angle3 = 0.2) visually works like angle3=0).

How should I reset position/rotation/scale correctly?




--
ñ?????.ï???????. ï? ???? ???? http://cards.yandex.ru/


------------------
Post generated by Mail2Forum
Back to top
Tomlinson, Gordon
Guest





PostPosted: Wed Nov 05, 2008 1:25 pm    Post subject:
How should I reset position/rotation/scale using
Reply with quote

See http://www.openscenegraph.org/projects/osg/wiki/Community/Contractors for a list of users who provide OSG services and paid technical support


Gordon

__________________________________________________________
Gordon Tomlinson

Product Manager 3D
Email : gtomlinson @ overwatch.textron.com
__________________________________________________________

"Self defence is not a function of learning tricks
but is a function of how quickly and intensely one
can arouse one's instinct for survival"
- Master Tambo Tetsura



-----Original Message-----
From: [mailto:] On Behalf Of GMD GammerMaxyandex.ru
Sent: Wednesday, November 05, 2008 7:45 AM
To: ; Robert Osfield
Subject: Re: How should I reset position/rotation/scale usingMatrixTransform?

Thanks Robert,
PositionAttitudeTransform works as I nedded. But can I reset matrix transformation using MatrixTransform?

Robert, answer please, is there any paied technical support of OSG which can helps me do some things with OSG or give advices about how can I realize some of my ideas better? If there is some thing like this could you give me they contacts.

Thanks, Max.


05.11.08, 13:17, "Robert Osfield" <>:

Quote:
Hi ??? Please use the mailing list convention of signing with the name
you wish to be addressed with, Might I recommend you use
osg::PositionAttitudeTransform? This manages the potioning, scaling,
rotation and pivot point all as separate variables so there is no need
to try an decompose a Matrix into its part and recombine.
Robert.
On Wed, Nov 5, 2008 at 5:47 AM, GMD GammerMaxyandex.ru
<> wrote:
Quote:
Hi. I have question about MatrixTransform.
How should I reset position/rotation/scale using MatrixTransform?
Code:

{
osg::Matrix mat;
osg::Vec3d _Trans = MyMatrixTransform->getMatrix().getTrans();
osg::Quat _Rotate =MyMatrixTransform->getMatrix().getRotate();
osg::Vec3d _Scale = MyMatrixTransform->getMatrix().getScale();
MyMatrixTransform->setMatrix(osg::Matrix::scale(1.0f,1.0f,1.0f) *
osg::Matrix::rotate(0.0f,0.0f,0.0f,1.0f)*
osg::Matrix::translate(0.0f,0.0f,0.0f));
mat = osg::Matrix::scale(1.0f,1.0f,1.0f) *
osg::Matrix::rotate(0.0f,0.0f,0.0f,1.0f) *
osg::Matrix::translate(0.0f,0.0f,0.0f);
if (!scale) mat.preMult (osg::Matrix::scale(_Scale)); if (!rotate)
mat.preMult (osg::Matrix::rotate(_Rotate)); if (!position)
mat.preMult (osg::Matrix::translate(_Trans));
MyMatrixTransform->setMatrix (mat);
}


After that rotation (
MyMatrixTransform->getMatrix().preMult(osg::Matrix::rotate(angle3,osg::Vec3d(0,0,1))); ) depends from scale (when scale is 10.0, rotation (angle3 = 0.2) visually works like angle3=0).

How should I reset position/rotation/scale correctly?

h.org


org

--
ñ?????.ï???????. ï? ???? ???? http://cards.yandex.ru/


------------------
Post generated by Mail2Forum
Back to top
Jean-Se'bastien Guay
Guest





PostPosted: Wed Nov 05, 2008 2:05 pm    Post subject:
How should I reset position/rotation/scale using
Reply with quote

Hi Max,

Quote:
But can I reset matrix transformation using MatrixTransform?

I think you need to brush up on some basic math concepts.

matrixTransform->setMatrix(osg::Matrix::identity());

The identity matrix is a matrix where scale = (1,1,1), translation =
(0,0,0) and there is no rotation.

Quote:
Robert, answer please, is there any paied technical support of OSG which can helps me do some things with OSG or give advices about how can I realize some of my ideas better? If there is some thing like this could you give me they contacts.

Cedric and Gordon already answered. Check the list of contractors on the
wiki.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay
http://www.cm-labs.com/
http://whitestar02.webhop.org/


------------------
Post generated by Mail2Forum
Back to top
GMD GammerMaxyandex.ru
Guest





PostPosted: Wed Nov 05, 2008 3:18 pm    Post subject:
How should I reset position/rotation/scale using
Reply with quote

Thank you.

How should I reset position *OR* rotation *OR* scale using MatrixTransform

How should I reset position
or
How should I reset position & scale
or
How should I reset scale & rotation
...


05.11.08, 16:54, "Jean-Se'bastien Guay" <>:

Quote:
Hi Max,
Quote:
But can I reset matrix transformation using MatrixTransform?
I think you need to brush up on some basic math concepts.
matrixTransform->setMatrix(osg::Matrix::identity());
The identity matrix is a matrix where scale = (1,1,1), translation =
(0,0,0) and there is no rotation.
Quote:
Robert, answer please, is there any paied technical support of OSG which can helps me do some things with OSG or give advices about how can I realize some of my ideas better? If there is some thing like this could you give me they contacts.
Cedric and Gordon already answered. Check the list of contractors on the
wiki.
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay
http://www.cm-labs.com/
http://whitestar02.webhop.org/


--
ñ?????.ï???????. ÀÏ?Ï?Ï ???ÍÁ??? http://cards.yandex.ru/


------------------
Post generated by Mail2Forum
Back to top
Jean-Se'bastien Guay
Guest





PostPosted: Wed Nov 05, 2008 3:27 pm    Post subject:
How should I reset position/rotation/scale using
Reply with quote

Hi Max,

Quote:
How should I reset position *OR* rotation *OR* scale using MatrixTransform

Decomposing the matrix is not that reliable. Keep them separately, or
use PositionAttitudeTransform.

Remember that mt->setMatrix(osg::Matrix::scale(...) *
osg::Matrix::rotate(...) * osg::Matrix::translate(...)) is functionally
equivalent to one MatrixTransform with scale, with a child
MatrixTransform with rotation, and another child MatrixTransform with
translate (or some permutation, I can never remember).

J-S
--
______________________________________________________
Jean-Sebastien Guay
http://www.cm-labs.com/
http://whitestar02.webhop.org/


------------------
Post generated by Mail2Forum
Back to top
GMD GammerMaxyandex.ru
Guest





PostPosted: Wed Nov 05, 2008 7:27 pm    Post subject:
How should I reset position/rotation/scale using
Reply with quote

Thank you! it works)

05.11.08, 18:27, "Jean-Se'bastien Guay" <>:

Quote:
Hi Max,
Quote:
How should I reset position *OR* rotation *OR* scale using MatrixTransform
Decomposing the matrix is not that reliable. Keep them separately, or
use PositionAttitudeTransform.
Remember that mt->setMatrix(osg::Matrix::scale(...) *
osg::Matrix::rotate(...) * osg::Matrix::translate(...)) is functionally
equivalent to one MatrixTransform with scale, with a child
MatrixTransform with rotation, and another child MatrixTransform with
translate (or some permutation, I can never remember).
J-S
--
______________________________________________________
Jean-Sebastien Guay
http://www.cm-labs.com/
http://whitestar02.webhop.org/


--
ñ?????.ðÏ??Á. ðÏ?Ý??? ?ÐÁÍ ???-?????? ?Ý? http://mail.yandex.ru/nospam


------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts First Person Camera disable inertial ... Ligvest General 3 Thu Mar 28, 2019 1:01 pm View latest post
No new posts Large scale point clouds rendering wi... saedrna1 General 1 Fri Mar 08, 2019 8:01 am View latest post
No new posts How do I continuously read the mouse ... kornerr General 9 Wed Feb 06, 2019 2:02 pm View latest post
No new posts setViewMatrixAsLookAt not working to ... Rodrigo General 4 Tue Jan 08, 2019 2:48 am View latest post
No new posts Happy New Year to all OSG Users Chris Hanson General 0 Mon Jan 07, 2019 10:17 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP