POV-Ray : Newsgroups : povray.advanced-users : Following an object in space Server Time
24 Nov 2024 19:52:33 EST (-0500)
  Following an object in space (Message 1 to 2 of 2)  
From: Defective
Subject: Following an object in space
Date: 10 Mar 2005 00:42:25
Message: <r1nv211kanj6hofu5cm36b0n6j6v4cmrg0@4ax.com>
Been a while since I read every post here...

(So, if this has already been hashed out, feel free to point me in
that direction...)

I'm trying to figure out a way to keep track of the coordinates of an
object in a scene.  The object moves based on the movement of its
connection to other objects.

The end result should be to enable connecting this object to a point
on an earlier object in the chain.

I can come up with ways to model it outside of POV, but not inside
POV.

Unless, of course, there's a mechanism of some sort built in that I'm
missing...

(Of course, it IS past midnight.  My brain may simply be fried...)

Thanks in advance for any help.

SAM


Post a reply to this message

From: Tim Attwood
Subject: Re: Following an object in space
Date: 10 Mar 2005 05:31:39
Message: <4230220b$1@news.povray.org>
"Defective" <def### [at] rogerscom> wrote in message 
news:r1nv211kanj6hofu5cm36b0n6j6v4cmrg0@4ax.com...
> Been a while since I read every post here...
>
> (So, if this has already been hashed out, feel free to point me in
> that direction...)
>
> I'm trying to figure out a way to keep track of the coordinates of an
> object in a scene.  The object moves based on the movement of its
> connection to other objects.
>
> The end result should be to enable connecting this object to a point
> on an earlier object in the chain.
>
> I can come up with ways to model it outside of POV, but not inside
> POV.
>
> Unless, of course, there's a mechanism of some sort built in that I'm
> missing...
>
> (Of course, it IS past midnight.  My brain may simply be fried...)
>
> Thanks in advance for any help.
>
> SAM
>

Modeling the objects is easy... just attach the smallest objects first and 
work back to the base.

#declare finger = .... // some finger
#declare thumb = ... // some thumb
#declare palm = ... // some palm
#declare forearm = ... // some forearm
#declare bicep = ... // some bicep
#declare torso = ... // some body

#declare hand = union {
    object {finger rotate ... translate ...} // fingers x 4
    object {thumb rotate ... translate ...} // a thumb
    object {palm } // a palm
};

#declare arm1 = union {
   object {hand rotate ... translate ...}// hand
   object {forearm }// forarm
};

#declare arm2 = union {
   object {arm1 rotate ... translate ...}// arm1
   object {bicep }// bicep
};

#declare robot = union {
   object {arm2 rotate ... translate ...}// arm2
   object {body} // body
};

The math is a bit harder, but  basically you do the same thing with a vector 
representing the point on the object you want to know.

#declare finger = ...; // point on finger when joint is at origin
#declare finger_rotation = ...; // rotation of finger on palm
#declare finger_translate = ...; // translation of finger onto palm
#declare hand_rotation = ...; // rotation of hand
#declare hand_translate = ...; // translation of hand
#declare arm1_rotation = ...; // rotation of arm1
#declare arm1_translate = ...; // translation arm1
#declare arm2_rotation = ...; // rotation of arm2
#declare arm2_translate = ...; // translation of arm2 onto body

#declare finger_hand = vrotate(finger,finger_rotation) + finger_translate;
#declare finger_arm1= vrotate(finger_hand,hand_rotation) + hand_translate;
#declare finger_arm2= vrotate(finger_arm1,arm1_rotation) + arm1_translate;
#declatre finger_body = vrotate(finger_arm2,arm2_rotation) + arm2_translate;

Unfortunatly this only works well in one direction, figuring out where the 
finger is.  Calculating the arm angles needed to actually move a robot hand 
to actually pick up an object at a certain place is a whole different kettle 
of fish. Mostly because there are multiple solutions to the problem. 
http://www.learnaboutrobots.com/inverseKinematics.htm


Post a reply to this message

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