POV-Ray : Newsgroups : povray.binaries.images : Debug my mesh2 macro! : Re: Debug my mesh2 macro! Server Time
2 Aug 2024 08:17:46 EDT (-0400)
  Re: Debug my mesh2 macro!  
From: Chris B
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

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