POV-Ray : Newsgroups : povray.advanced-users : Facing objects Server Time
29 Jul 2024 12:15:32 EDT (-0400)
  Facing objects (Message 1 to 4 of 4)  
From: Rohan Bernett
Subject: Facing objects
Date: 30 Jul 2002 01:40:06
Message: <web.3d46268eeedc796bd02c7b870@news.povray.org>
A couple of questions relating to rotation:

How do I make an object always face the camera, like the sprites do in
Duke3D?

How do I make an object moving along a spline turn to match the spline? I
know it's easy to do with the camera, just set look_at to clock+0.1, but
how do I do it with any object?

Can anyone help?

Rohan _e_ii


Post a reply to this message

From: hughes b
Subject: Re: Facing objects
Date: 30 Jul 2002 03:44:45
Message: <3d4643ed@news.povray.org>
"Rohan Bernett" <rox### [at] yahoocom> wrote in message
news:web.3d46268eeedc796bd02c7b870@news.povray.org...
> A couple of questions relating to rotation:
>
> How do I make an object always face the camera, like the sprites do in
> Duke3D?
>
> How do I make an object moving along a spline turn to match the spline? I
> know it's easy to do with the camera, just set look_at to clock+0.1, but
> how do I do it with any object?

Take a look at scenes\incdemo\screen.pov and its associated screen.inc. The
Camera_Transform in that creates a face-the-camera effect.

You might even adapt that to a spline as well, not sure though.
I think you could actually get the path-pointing thing done by duplicating
the path spline and altering the timing intervals so that the pointing
direction is just a copy of the path with a slight advance in timing.
You won't get the proper effect if you simply add 0.1 to the vector because
of positives and negatives. Once the camera or object faces toward -z
instead of +z, for example, it still wants to look toward +z. No good.
So, let's say, getting the front of a rocket to point toward where it's
going when using a pair of splines you'll need to use one vector as the
overall motion and the pointing vector as a direction. The motion vector is
the baseline, the pointing vector must either be used as a anchor for the
tip of the rocket (end of a cylinder, etc.) or some calculation needs to be
done between the two vectors.

I think one of the math.inc macros could help with the second way but I
don't have any ideas about that, sorry.


Post a reply to this message

From: ABX
Subject: Re: Facing objects
Date: 30 Jul 2002 05:44:57
Message: <gtncku4adbg6up1iv3pcaoc3c544q8gidg@4ax.com>
On Tue, 30 Jul 2002 02:44:29 -0500, "hughes b" <omn### [at] charternet> wrote:
> You might even adapt that to a spline as well, not sure though.

There is macro Spline_Trans() in transforms.inc in 3.5.

ABX


Post a reply to this message

From: Jan Maarten van der Valk
Subject: Re: Facing objects
Date: 30 Jul 2002 17:32:55
Message: <3d470607@news.povray.org>
"Rohan Bernett" wrote
>
> How do I make an object moving along a spline turn to match the spline? I
> know it's easy to do with the camera, just set look_at to clock+0.1, but
> how do I do it with any object?
>

See \scenes\animations\splinefollow

JM

--
#macro J(M)V()<V(),V(),V()>#if(M)J(M)#end#end#local _=20;#macro V()asc(substr
("IIMYKIIYMMKQOIMYQEEYSCEYUEGQWEHYYIGQ[HEY]IGY_JGQaJEYcKGYeKGQgLEYiMKIs!K!",
73-M,1))/2-36.5#declare M=M-1;#end#local a=spline{cubic_spline J(72)}#while
(_)sphere{a(_).1pigment{rgb(a(_)+(x+y)*3.5)}}#local _=_-.02;#end//JM


Post a reply to this message

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