POV-Ray : Newsgroups : povray.general : Where's that rotation advice? Server Time
8 Aug 2024 16:15:53 EDT (-0400)
  Where's that rotation advice? (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Greg M  Johnson
Subject: Where's that rotation advice?
Date: 21 Jan 2001 17:54:58
Message: <3a6b68c2@news.povray.org>
I thought I saw somewhere around here recently a post where someone got
advice on how to find the
rotate <xang,yang,zang>
to make vector <x1,y1,z1> parallel to vector <x2,y2,z2>

but I'm sorry I cannot find it.


Post a reply to this message

From: Alan Kong
Subject: Re: Where's that rotation advice?
Date: 21 Jan 2001 18:10:15
Message: <3vqm6tgnhr038d9bngvtu8q9go1hcg0tfp@4ax.com>
On Sun, 21 Jan 2001 17:53:45 -0500 "Greg M. Johnson"
<"gregj;-()"@aol.c;-()om> wrote:

>I thought I saw somewhere around here recently a post where someone got
>advice on how to find the
>rotate <xang,yang,zang>
>to make vector <x1,y1,z1> parallel to vector <x2,y2,z2>
>
>but I'm sorry I cannot find it.

  Greg, the articles you are looking for may be in p.advanced-users,
posted from 09-Jan-2001 to 13-Jan-2001. There is more than one thread
that pertains to that topic but you may have to hunt through ambiguous
Subject lines.

-- 
Alan - ako### [at] povrayorg - a k o n g <at> p o v r a y <dot> o r g
http://www.povray.org - Home of the Persistence of Vision Ray Tracer


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Where's that rotation advice?
Date: 21 Jan 2001 18:55:45
Message: <3A6B76C9.1D38516@online.no>
"Greg M. Johnson" wrote:
> 
> I thought I saw somewhere around here recently a post where someone got
> advice on how to find the
> rotate <xang,yang,zang>
> to make vector <x1,y1,z1> parallel to vector <x2,y2,z2>
> 
> but I'm sorry I cannot find it.

In news://news.povray.org/povray.advanced-users
I found these threads:

08. Sept. 2000, matrix help....
news://news.povray.org/39B93D2B.781F84C5%40psu.edu

23. Nov. 2000, Rotate object to lie along a vector
news://news.povray.org/3a1c61d8%40news.povray.org


If the answers you seek are not within these threads,
then I can try to help if you want me to.


-- 
Best regards,

Tor Olav

mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Where's that rotation advice?
Date: 22 Jan 2001 09:52:25
Message: <3A6C47CE.59086ECB@my-dejanews.com>
Thanks all.  Rune actually answered this question in July. Because it was
so useful, I'm pasting it here again:

// By Rune Johansen, Thu, 6 Jul 2000
// Perpendiculize will adjust the vector V1
// so that it is perpendicular to the vector V2.
// The input is V1 and V2, and the macro returns
// the adjusted version of V1.
#macro Perpendiculize (V1,V2) // by Rune S. Johansen
   vnormalize(vcross(vcross(V2,V1),V2))
#end

// FindAngle will find the angle between V1 and V2.
// The third parameter "About" is a vector which must be
// perpendicular to both V1 and V2. If the rotation from
// V1 to V2 about "About" is negative, the returned angle
// is negative. ( When you look in the direction of "About"
// clockwise is negative and anticlockwise is positive. )
// If you set "about" to <0,0,0> the returned angle will
// always be positive (or zero).
#macro FindAngle (V1,V2,About)
   degrees(acos(vdot(vnormalize(V1),vnormalize(V2))))
   *(vdot(About,vcross(V1,V2))<0?-1:1)
#end

// Given 2 vectors, a vector for the X direction
// (similar to the 1st - 3rd number in a matrix),
// and one for the Y direction (similar to the
// 4th - 6th number in a matrix), Vectors2Rotate will
// return a rotation vector which will transform an
// object in the same way as a matrix using the
// vectors would do. VectorX and VectorY must be
// perpendicular to each other.
#macro Vectors2Rotate (VectorX,VectorY) // by Rune S. Johansen
   #local RotZ = FindAngle(x,<VectorX.x,VectorX.y,0>,z);
   #local RotY = FindAngle(x,vrotate(VectorX,-RotZ*z),y);
   #local RotX = FindAngle(vrotate(y,<0,RotY,RotZ>),VectorY,VectorX);
   <RotX,RotY,RotZ>
#end


Post a reply to this message

From: Rune
Subject: Re: Where's that rotation advice?
Date: 22 Jan 2001 12:08:30
Message: <3a6c690e@news.povray.org>
"Greg M. Johnson" wrote:
> Rune actually answered this question in July.

I see you found it... :)

Just curious - what are you going to use it for?

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 6)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Where's that rotation advice?
Date: 22 Jan 2001 13:21:51
Message: <3A6C78D9.3E7AC508@my-dejanews.com>
Rune wrote:

> Just curious - what are you going to use it for?

Going to a pure IK leg in a new character, following some of the advice
you gave H.E.Day last year, and keeping true FK construction.  See start
of code in p.b.i.

But frankly at this hour I'm still not out of woods, and when I looked
at your Vectors2Rotate  I saw it wasn't what I was looking for....

I used FindKnee successfully to find the knee. But I *do not* want to
simply make my thigh a cylinder from hip point to knee point. I want a
transform{} to be placed on an object{thigh}.


Post a reply to this message

From: Rune
Subject: Re: Where's that rotation advice?
Date: 22 Jan 2001 16:41:47
Message: <3a6ca91b@news.povray.org>
"Greg M. Johnson" wrote:
> Going to a pure IK leg in a new character, following some
> of the advice you gave H.E.Day last year, and keeping
> true FK construction.

I still don't see why you stick to that FK idea... :)

Anyway, why does the output have to be rotation vectors? Why not transforms?
Transforms are much easier to handle...

> But frankly at this hour I'm still not out of woods, and
> when I looked at your Vectors2Rotate  I saw it wasn't
> what I was looking for....

Not directly anyway...

> I used FindKnee successfully to find the knee. But I
> *do not* want to simply make my thigh a cylinder from
> hip point to knee point. I want a transform{} to be
> placed on an object{thigh}.

And that's what I explained in the post for H.E.Day. But maybe that's
exactly what you meant.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 6)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Where's that rotation advice?
Date: 22 Jan 2001 17:13:18
Message: <3A6CAF18.5B9452FA@my-dejanews.com>
Thanks, am using transforms.  I never did figure out how to get the operations
that happen in jvs' Reorient macro to happen inside a transform. I instead had
to redefine my shinobject with the Reorient macro.

I just sacrificed a little elegance in my code by using:
  $rshinobj=object{rshinobj Reorient(rankpt-rkneept,rtemprankpt-rtempkneept)}
  $rshintrans= transform{ translate rtempkneept}

when I was hoping for:
  $rshintrans= transform{ rotate An_UnAttainableVector  translate rtempkneept}

But thanks I now have a working system, with lifting heel and rotatable
head,neck, hip,lumbar,ribcage.  Will show anims eventually.

While we're talking, what exactly do you use to vary your variables in an anim?
exactly what kind of spline, etc.?

Thanks.


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Where's that rotation advice?
Date: 23 Jan 2001 07:52:15
Message: <3A6D7D19.99613415@my-dejanews.com>
"Greg M. Johnson" wrote:

> I never did figure out how to get the operations
> that happen in jvs' Reorient macro to happen inside a transform.

Here's how:

#macro Oritransform(Axis1,Axis2)
      #declare vX1=vnormalize(Axis1);
      #declare vX2=vnormalize(Axis2);
      #declare vY=vnormalize(vcross(vX1,vX2));
      #declare vZ1=vnormalize(vcross(vX1,vY));
      #declare vZ2=vnormalize(vcross(vX2,vY));
      transform{
        matrix < vX1.x, vY.x,vZ1.x, vX1.y,vY.y,vZ1.y, vX1.z,vY.z, vZ1.z, 0,0,0 >
        matrix < vX2.x,vX2.y,vX2.z,  vY.x,vY.y, vY.z, vZ2.x,vZ2.y,vZ2.z, 0,0,0 >
      }
#end

> I instead had
> to redefine my shinobject with the Reorient macro.
>
> I just sacrificed a little elegance in my code by using:
>   $rshinobj=object{rshinobj Reorient(rankpt-rkneept,rtemprankpt-rtempkneept)}
>   $rshintrans= transform{ translate rtempkneept}


Post a reply to this message

From: Rune
Subject: Re: Where's that rotation advice?
Date: 23 Jan 2001 09:20:33
Message: <3a6d9331@news.povray.org>
"Greg M. Johnson" wrote:
> While we're talking, what exactly do you use to vary your
> variables in an anim? exactly what kind of spline, etc.?

I use cubic_splines. This works well for me since I've never used rotation
vectors to define poses, but direction vectors instead.

(Personally I have always disliked specifying poses with rotation_vectors. I
find it difficult to find the right combination of x, y, and z-rotation
required to align a limp as I want it.)

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 6)
/ Also visit http://www.povrayusers.org


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.