POV-Ray : Newsgroups : povray.general : Vector help. Server Time
1 Nov 2024 03:15:24 EDT (-0400)
  Vector help. (Message 1 to 3 of 3)  
From: mr art
Subject: Vector help.
Date: 23 Nov 1999 15:12:24
Message: <383AF50B.C2FA372D@gci.net>
Help! Vectors have fried my brain! Or maybe it is this stuffed
head feeling from the cold I have. Don't know.
I am trying to get the eyes in a mannequin to focus on a point.
I know that this means that each eye needs different rotation
information. I tried to figure out a function that lets me 
specify the position of an eye(relitive to the head of course),
the normal direction that the eye looks, and the point that I want
them to look at. And that is about as far as I get. After that my
mind gets abducted by some aliens that wont give it back until
I drink massive amounts of coffee. And even then it don't work
the way it should.
So, can anyone help with the vector stuff? I think that I have
the aliens thing licked. Just need an expresso machine installed
next to the flatbed scanner. With a direct line to a major vain.
Mr. Art


Post a reply to this message

From: Chris Huff
Subject: Re: Vector help.
Date: 23 Nov 1999 15:19:46
Message: <231119991522558698%chrishuff_99@yahoo.com>
From the macro collection at http://twysted.net/

    From time to time you will have something lying along a certain
axis, and you'll want to turn it so that it points along another. This
macro will do that.
Like all the other forms of rotation, it presumes that the object is at
the origin; if the object away from the origin, the usual consequences
will follow.
object { MyObject
  Reorient(y,<1,-2,1.5>)
}

#macro Reorient(Axis1,Axis2)
  #local vX1=vnormalize(Axis1);
  #local vX2=vnormalize(Axis2);
  #local vY=vnormalize(vcross(vX1,vX2));
  #local vZ1=vnormalize(vcross(vX1,vY));
  #local vZ2=vnormalize(vcross(vX2,vY));
  matrix < vX1.x, vY.x,vZ1.x,
           vX1.y,vY.y,vZ1.y,
           vX1.z,vY.z, vZ1.z,
           0,0,0>
  matrix < vX2.x,vX2.y,vX2.z,
           vY.x,vY.y, vY.z,
           vZ2.x,vZ2.y,vZ2.z,
           0,0,0>
#end

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: mr art
Subject: Re: Vector help.
Date: 23 Nov 1999 20:54:54
Message: <383B4554.B523C94E@gci.net>
Chris, thanks.
I looked at the twysted.net and found something that worked.

#macro v_lookat(P1,P2)
	#local Norm=(vnormalize(P2-P1));
	<0,-degrees(asin(Norm.z)),degrees(asin(Norm.y))>
#end

used like this
object	{
	Eye
	rotate v_lookat(point_to_look_at ,location_of_eye)
	translate location_of_eye
	}

Chris Huff wrote:
> 
> From the macro collection at http://twysted.net/
>


Post a reply to this message

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