 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Has anyone ever made a pov-ray macro for inverse kinematics? I've been
working on one for a few days and have managed to get the basics down,
but now I am kind of confused. I got it to fit two limbs between two
given points, but I'm not quite sure how to go about creating the joints
and limitations. I was just wondering if anyone had ever made one so I
could get a couple of ideas.
thanks
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Reusser wrote:
>
> Has anyone ever made a pov-ray macro for inverse kinematics? I've been
> working on one for a few days and have managed to get the basics down,
> but now I am kind of confused. I got it to fit two limbs between two
> given points, but I'm not quite sure how to go about creating the joints
> and limitations. I was just wondering if anyone had ever made one so I
> could get a couple of ideas.
>
> thanks
Check out - http://rsj.mobilixnet.dk/3d/ikn/ikn.html
--
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Reusser" wrote:
> Has anyone ever made a pov-ray macro for inverse kinematics?
If you're making an long neck-like structure you may find my ikn.inc file
helpful as Ken pointed out.
However, it sounds more like your trying to make an IK leg or arm or
something like that. I have posted a message to povray.binaries.scene-files
some time ago explaining how to do that.
But the message was posted October 24 2000, so you might not have it in your
cache, and I have later found out that it had some bugs in it.
So I have posted a new message to povray.binaries.scene-files. It's called
"How to make an IK leg". Please let me know if you find it helpful!
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 28)
/ Also visit http://www.povrayusers.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Rune wrote:
> So I have posted a new message to povray.binaries.scene-files. It's called
> "How to make an IK leg". Please let me know if you find it helpful!
Thank you very much! I had the same idea going, but I got confused with the
details of how to rotate the limbs to point in the right direction. Now that I
know of the vcross and vnormalize functions, I'll be able to get the basics
down without a bunch of buggy macros. Thanks again!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Reusser" wrote:
> Thank you very much!
Glad you could use 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 28)
/ Also visit http://www.povrayusers.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Rune wrote:
> "Reusser" wrote:
> > Thank you very much!
>
> Glad you could use it! :)
>
> Rune
Thanks again, again, but I did notice one small improvement you could
make. If you replace the knee direction definition with these lines:
#declare HipAxis = <1,0,0>
#declare KneeDirection =
vnormalize(vcross(AnklePoint-HipPoint,HipAxis));
you can get a wider range of movement before the whole thing flips or
before you get an error because the knee direction is parallel to the
line between the hip and ankle.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thanks Rune! :-)
Sep
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thanks Ruesser!! (what a bountiful day!)
Sep
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Reusser" wrote:
> I did notice one small improvement you could make.
> If you replace the knee direction definition with these lines:
>
> #declare HipAxis = <1,0,0>
> #declare KneeDirection =
> vnormalize(vcross(AnklePoint-HipPoint,HipAxis));
>
> you can get a wider range of movement before the whole thing
> flips or before you get an error because the knee direction is
> parallel to the line between the hip and ankle.
Are you sure? Have you actually tested it?
Have you considered line 84 in my code:
#declare KneeVector = Perpendiculize(KneeDirection,HipPoint-AnklePoint);
I think it does just about the same thing. If not, please explain further!
:)
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 28)
/ Also visit http://www.povrayusers.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Setepenaset" wrote:
> Thanks Rune! :-)
You're welcome - glad you could use it too! :)
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 28)
/ Also visit http://www.povrayusers.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Rune wrote:
> Are you sure? Have you actually tested it?
>
> Have you considered line 84 in my code:
>
> #declare KneeVector = Perpendiculize(KneeDirection,HipPoint-AnklePoint);
My idea was actually due to trial and error before I saw line 84, but it
still fixed the error I had when I bent the leg too far back. When the leg
was too far back, the whole leg would flip over or give me an error if the
ankle and the hip had the same y-coord.: shin -> \/ <-thigh.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Reusser" wrote:
> My idea was actually due to trial and error before I saw
> line 84, but it still fixed the error I had when I bent the
> leg too far back. When the leg was too far back, the whole
> leg would flip over or give me an error if the ankle and the
> hip had the same y-coord.: shin -> \/ <-thigh.
That's because the KneeDirection have to be adjusted to fit the leg.
If the leg is like this: shin -> \/ <-thigh.
Then the knee points downwards and thus the KneeDirection must point
downwards too. The code adjusts the KneeDirection pretty much, but it can't
read your mind - you have to tell it roughly in which direction you want the
knee to point! :)
With your method the KneeDirection is calculated automatically, but then you
just have to specify a HipAxis instead. It's not a better or worse solution,
just a different approach. Personally I find it more intuitive to specify
the KneeDirection than to specify the HipAxis.
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 28)
/ Also visit http://www.povrayusers.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Rune wrote:
> That's because the KneeDirection have to be adjusted to fit the leg.
> If the leg is like this: shin -> \/ <-thigh.
> Then the knee points downwards and thus the KneeDirection must point
> downwards too. The code adjusts the KneeDirection pretty much, but it can't
> read your mind - you have to tell it roughly in which direction you want the
> knee to point! :)
>
> With your method the KneeDirection is calculated automatically, but then you
> just have to specify a HipAxis instead. It's not a better or worse solution,
> just a different approach. Personally I find it more intuitive to specify
> the KneeDirection than to specify the HipAxis.
I agree completely, but I just found it to be a little easier with animations
when the knee direction changes and you can just let the computer do the work
instead of manually changing the direction.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Reusser" wrote:
> I agree completely, but I just found it to be a little easier
> with animations when the knee direction changes and you can
> just let the computer do the work instead of manually changing
> the direction.
I think perhaps generally it is easier to use the HipAxis method when the
leg movement is confined to a single plane, while with more free movements
the manual KneeDirection is more intuitive. Just a thought.
By the way, I have uploaded the scene file to my website for future
reference. (Questions like yours come up once in a while...)
http://rsj.mobilixnet.dk/3d/goodies/goodies.html
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 March 29)
/ Also visit http://www.povrayusers.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |