POV-Ray : Newsgroups : povray.binaries.images : Debug my mesh2 macro! Server Time
16 Nov 2024 02:26:03 EST (-0500)
  Debug my mesh2 macro! (Message 1 to 5 of 5)  
From: gregjohn
Subject: Debug my mesh2 macro!
Date: 2 Oct 2007 08:00:01
Message: <web.470231af393b433d34d207310@news.povray.org>
I've been working on a macro to do character animation. It is similar to
Mike Williams' sweep mesh work, only this one allows for any spline as the
cross section along each point. Thus  instead of a "worm" one can have a
thigh shape, a calf muscle shape, a lower calf shape, etc.   It may also
seem like I'm doing a bunch of funny business with redefining my splines
back and forth, but this allows me to have a smoothly varying radius.

But as you can see, something is going haywire when it has to bend over!

(scene file to p.b.s-f.  image file to p.b.i.)


Post a reply to this message


Attachments:
Download 'gmesh18.png' (59 KB)

Preview of image 'gmesh18.png'
gmesh18.png


 

From: Chris B
Subject: Re: Debug my mesh2 macro!
Date: 2 Oct 2007 11:12:04
Message: <47025fc4$1@news.povray.org>
"gregjohn" <pte### [at] yahoocom> wrote in message 
news:web.470231af393b433d34d207310@news.povray.org...
> I've been working on a macro to do character animation. It is similar to
> Mike Williams' sweep mesh work, only this one allows for any spline as the
> cross section along each point. Thus  instead of a "worm" one can have a
> thigh shape, a calf muscle shape, a lower calf shape, etc.   It may also
> seem like I'm doing a bunch of funny business with redefining my splines
> back and forth, but this allows me to have a smoothly varying radius.
>
> But as you can see, something is going haywire when it has to bend over!
>
> (scene file to p.b.s-f.  image file to p.b.i.)
>

Hi Greg,

I've seen a couple of questions lately about this same sort of thing. It's a 
problem I came across when doing clothing for characters and, if memory 
serves me correctly it's down to the use of Reorient_trans. This rotates the 
object by the shortest route around a vector perpendicular to the two 
vectors specified as parameters. However, if the start and end vectors are 
facing in the opposite direction then all of the vectors in a circle around 
the middle are perpendicular so it has to just choose one and the 
orientation of the point you end up with depends upon which one it chooses.

If you imagine a coin standing up from the origin with the queens face 
facing you (it's a Britich coin) with the camera at -n*z and using reorient 
trans to rotate it around the Z axis, then the queens face will still be 
facing you as it approaches the 180 degree point. If instead you rotate it 
around the X axis you get to see the back of the coin after it passes the 90 
degree point. So the orientation as it approaches 180 degrees depends upon 
which axis it's being rotated around.

I solved this for my purposes by working out a perpendicular point at the 
start of a sweep and making sure it transitioned smoothly from the previous 
value. Then I rotated around that rather than using Reorient_Trans. It's a 
couple more lines of code, but it worked for me.

Regards,
Chris B.


Post a reply to this message

From: Charles C
Subject: Re: Debug my mesh2 macro!
Date: 2 Oct 2007 17:30:00
Message: <web.4702b6cfb4a2659cc667cf480@news.povray.org>
"gregjohn" <pte### [at] yahoocom> wrote:
> I've been working on a macro to do character animation. It is similar to
> Mike Williams' sweep mesh work, only this one allows for any spline as the
> cross section along each point. Thus  instead of a "worm" one can have a
> thigh shape, a calf muscle shape, a lower calf shape, etc.   It may also
> seem like I'm doing a bunch of funny business with redefining my splines
> back and forth, but this allows me to have a smoothly varying radius.
>
> But as you can see, something is going haywire when it has to bend over!
>
> (scene file to p.b.s-f.  image file to p.b.i.)

I don't have time to look at your code at the moment, but I hope to later.
The way I'm handling it though is to use two vectors for each bone, one for
direction and length and another (perpendicular) vector for
orientation/twist.  For a spine/backbone a series of vector pairs turn into
a pair of 'parallel' splines with orientation explicitly defined the whole
way by the 2nd spline.   For limbs, I'm not using two splines, but I'm
using the 'bones' more directly.

I'm not using vorient_transform (sp), but instead using a macro which
figures sequential x y and z rotations based on two vectors assumed to have
the purposes described above.  The key is that for each angle check in the
macro, vectors are checked to see which side of 0 they're on to see which
direction to rotate by.

Charles


Post a reply to this message

From: gregjohn
Subject: Re: Debug my mesh2 macro!
Date: 2 Oct 2007 18:25:00
Message: <web.4702c520b4a2659c34d207310@news.povray.org>
"Charles C" <nomail@nomail> wrote:
> I'm not using vorient_transform (sp), but instead using a macro which
> figures sequential x y and z rotations based on two vectors assumed to have
> the purposes described above.

I think this is what Mike William's sweep spline did.  I had stared at that
code for a while, thinking it impossible to implement in my system. Your
post gave me the courage to try copying & pasting three lines from his
system and it worked!

Will post an improved code soon.


Post a reply to this message

From: gregjohn
Subject: Re: Debug my mesh2 macro!
Date: 2 Oct 2007 20:30:01
Message: <web.4702e1d5b4a2659c34d207310@news.povray.org>
"gregjohn" <pte### [at] yahoocom> wrote:

> Will post an improved code soon.


Post a reply to this message


Attachments:
Download 'gmesh26.png' (48 KB)

Preview of image 'gmesh26.png'
gmesh26.png


 

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