change bodyless geom rotation origin

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

change bodyless geom rotation origin

by atis-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I made an immovable ode object (=geom without body, no mass). I would
like rotate this geom but not around his centre but any point. Can i
do that? Any idea? thx
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "ode-users" group.
To post to this group, send email to ode-users@...
To unsubscribe from this group, send email to ode-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ode-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: change bodyless geom rotation origin

by Jon Watte (ODE)-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


atis wrote:
> I made an immovable ode object (=geom without body, no mass). I would
> like rotate this geom but not around his centre but any point. Can i
> do that? Any idea? thx
>  

Just create the appropriate matrix (in the 4x4 sense) and set the
translation and rotation appropriately.
This may require a matrix library outside of ODE, though; I forget
whether we actually have any 4x4 matrix functions.

Sincerely,

jw





--

  Revenge is the most pointless and damaging of human desires.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "ode-users" group.
To post to this group, send email to ode-users@...
To unsubscribe from this group, send email to ode-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ode-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: change bodyless geom rotation origin

by atis-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


sorry but i dont understand your answer:
for "dGeomSetRotation(...)" function need dMatrix3 (ode doc), which
size 3x4 and not 4x4.

On okt. 28, 21:42, Jon Watte <jwa...@...> wrote:

> atis wrote:
> > I made an immovable ode object (=geom without body, no mass). I would
> > like rotate this geom but not around his centre but any point. Can i
> > do that? Any idea? thx
>
> Just create the appropriate matrix (in the 4x4 sense) and set the
> translation and rotation appropriately.
> This may require a matrix library outside of ODE, though; I forget
> whether we actually have any 4x4 matrix functions.
>
> Sincerely,
>
> jw
>
> --
>
>   Revenge is the most pointless and damaging of human desires.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "ode-users" group.
To post to this group, send email to ode-users@...
To unsubscribe from this group, send email to ode-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ode-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: change bodyless geom rotation origin

by Jon Watte (ODE)-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Yes, but you don't want a rotation, you want a transform, because you
don't want to rotate around the local center.
A rigid transform is a 4x4 matrix, but can also be expressed as a 3x3
(rotation) and a vector (position). Those quantities can easily be
extracted from a 4x4 matrix representing a transform.
Thus, you want to calculate the transform "offset to center of rotation,
rotate, and offset back." You do this using 4x4 math. Then you extract
the 3x3 for rotation and the vector for translation, and set those
values into the dGeom.

By the way, please do not take this as an insult, but as a helpful
recommendation: This math should be obvious and intuitive to anyone who
works in 3D, or who paid attention in linear algebra class. I assumed I
wouldn't need to go into this much detail in explaining how to do the
very basics of 3D math algebra. Perhaps you should actually read up on
the basic math before you try to write some code in this area? I think
your experience would be a lot better if you actually understand these
basic concepts.

Sincerely,

jw


atis wrote:

> sorry but i dont understand your answer:
> for "dGeomSetRotation(...)" function need dMatrix3 (ode doc), which
> size 3x4 and not 4x4.
>
> On okt. 28, 21:42, Jon Watte <jwa...@...> wrote:
>  
>> atis wrote:
>>    
>>> I made an immovable ode object (=geom without body, no mass). I would
>>> like rotate this geom but not around his centre but any point. Can i
>>> do that? Any idea? thx
>>>      
>> Just create the appropriate matrix (in the 4x4 sense) and set the
>> translation and rotation appropriately.
>> This may require a matrix library outside of ODE, though; I forget
>> whether we actually have any 4x4 matrix functions.
>>
>> Sincerely,
>>
>> jw
>>
>> --
>>
>>   Revenge is the most pointless and damaging of human desires.
>>    
> >
>
>  


--

  Revenge is the most pointless and damaging of human desires.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "ode-users" group.
To post to this group, send email to ode-users@...
To unsubscribe from this group, send email to ode-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ode-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: change bodyless geom rotation origin

by atis-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


basic lineal algebra not problem for me. do you think yes? shame on
me! :) but the ODE api little bit strange after PhysX and Newton.

what does it mean "offset back"?



On Oct 28, 11:15 pm, Jon Watte <jwa...@...> wrote:

> Yes, but you don't want a rotation, you want a transform, tecause you
> don't want to rotate around the local center.
> A rigid transform is a 4x4 matrix, but can also be expressed as a 3x3
> (rotation) and a vector (position). Those quantities can easily be
> extracted from a 4x4 matrix representing a transform.
> Thus, you want to calculate the transform "offset to center of rotation,
> rotate, and offset back." You do this using 4x4 math. Then you extract
> the 3x3 for rotation and the vector for translation, and set those
> values into the dGeom.
>
> By the way, please do not take this as an insult, but as a helpful
> recommendation: This math should be obvious and intuitive to anyone who
> works in 3D, or who paid attention in linear algebra class. I assumed I
> wouldn't need to go into this much detail in explaining how to do the
> very basics of 3D math algebra. Perhaps you should actually read up on
> the basic math before you try to write some code in this area? I think
> your experience would be a lot better if you actually understand these
> basic concepts.
>
> Sincerely,
>
> jw
>
>
>
> atis wrote:
> > sorry but i dont understand your answer:
> > for "dGeomSetRotation(...)" function need dMatrix3 (ode doc), which
> > size 3x4 and not 4x4.
>
> > On okt. 28, 21:42, Jon Watte <jwa...@...> wrote:
>
> >> atis wrote:
>
> >>> I made an immovable ode object (=geom without body, no mass). I would
> >>> like rotate this geom but not around his centre but any point. Can i
> >>> do that? Any idea? thx
>
> >> Just create the appropriate matrix (in the 4x4 sense) and set the
> >> translation and rotation appropriately.
> >> This may require a matrix library outside of ODE, though; I forget
> >> whether we actually have any 4x4 matrix functions.
>
> >> Sincerely,
>
> >> jw
>
> >> --
>
> >>   Revenge is the most pointless and damaging of human desires.
>
> --
>
>   Revenge is the most pointless and damaging of human desires.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "ode-users" group.
To post to this group, send email to ode-users@...
To unsubscribe from this group, send email to ode-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ode-users?hl=en
-~----------~----~----~----~------~----~------~--~---