POV-Ray : Newsgroups : povray.animations : Need help Rotating : Re: Need help Rotating Server Time
1 Jun 2024 09:11:33 EDT (-0400)
  Re: Need help Rotating  
From: Chris B
Date: 3 Jun 2006 15:51:05
Message: <4481e829@news.povray.org>
"Divine Wind" <div### [at] hotmailcouk> wrote in message 
news:web.4481c5a0fd2cbf883a0196460@news.povray.org...
> I'm trying to make a human and this rotating thing also seems a little
> dificulte to grasp. I understand that all things should first be rotated
> around <0,0,0> this is is fine but...
> If you have an object say an arm that is attached to something fixed then 
> as
> I understand it you should first rotate the arm, then translate it. Then
> rotate the fore arm about the <0,0,0> ,or zero point, translate that, but
> then rotate and translate it again as I did with the arm...
> Now if I have a upper arm, lower arm, a palm, upper fingers, lower 
> fingers,
> and finger tips, that is 6 nested objects then is not the code going to
> look somthing like this...
>
> FingerTips...
> ... snip ...
>
> Now as I read the sudo code that I have just written 2 things stand out in
> my (small) mind.
> 1) This code looks S**t. So am I missing the point, as I carn't believe 
> that
> those great POV team guys would have intended this.
> 2) How do I use that rotate about an arbarty axis thingy in the inc files.
> Or again, am I missing the point.
>
> Sorry for any spelling mistakes I a god at spellliing.
>

Hi,

When I was doing a human, that's one of the things that I also found to be a 
bit tricky. There are quite a few approaches you could potentially use. I 
settled on one that is quite complex, but it enables me to specify a pose by 
simply defining the rotation of each body part relative to the next. I have 
a set of macros to do the rest. It also means I can 'fix' the location of 
any single body part I wish and it calculates the positions and rotations of 
the rest of the body parts relative to that one fixed part.

Essentially I use a series of arrays to hold the body part definitions and 
joint definitions along with arrays to hold the relative joint rotations. 
Once the pose is set in the joint rotations array I call a macro to 
calculate the absolute rotations and translations necessary to rotate and 
position each body part, calculating out from a fixed body part that I 
define using a control variable. Once this information is calculated I can 
work out the shape of things such as clothing that are dependant upon the 
body part positions and rotations. The clothing is then added into the 
object arrays before calling a macro to build a single object from all of 
the bits.

An alpha copy of the SDL that I wrote is available at 
http://www.geocities.com/povperson/ along with documentation that outlines 
all of the macros and control variables.
In the file povperson.inc there is a macro called ppResolvePose that does 
the main part of the calculation.
You can reuse any of those macros or use them for ideas on creating your own 
if you wish.

You could also just use the body parts you have created to define a figure 
in the right format for povperson, then you get all of the added extras for 
free (e.g. the walking animation, hair, the ability to 'morph' between poses 
etc.)

Regards,
Chris B.


Post a reply to this message

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