![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
#macro Orient_Z(v1,v2)
#local nx = vnormalize(v2-v1);
#local nz = vnormalize(vcross(nx,y)); // replace "y" with the things local
"up"
#local ny = vcross(nz,nx)
matrix <nx.x, nx.y, nx.z,
ny.x, ny.y, ny.z,
nz.x, nz.y, nz.z,
v1.x, v1.y, v1.z>
#end
This takes an object at the origin and places it at point v1 and points it
towards v2.
It is based on John Vansickles Reorient macro. I havne't figured out how to
do autobanking
Josh
Andrew Clinton wrote:
> Hello,
>
> Is there any macro available that will perform on an object the same
> function as the look_at command does in a camera?
>
> In other words, I have an object at <0,0,0> and oriented in the +z
> direction, and I wish to perform an x-rotation then a y-rotation so that
> the object is now pointing at a given point (as in the look_at point for
> the Camera). I've been using John VanSickle's Reorient macro, but in
> some cases the object receives an undesireable z-rotation so that it
> becomes tilted wrong.
>
> I've been banging my head for a while about this, any help would be
> appreciated!
>
> Andrew C
--
Josh English
eng### [at] spiritone com
"May your hopes, dreams, and plans not be destroyed by a few zeros."
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Wow, several stones can kill this one bird... I count 5 macros that do
basically the same thing! Thanks for all your help, I got it solved.
btw, if anyone's interested, I'm working on a system that will create rock
walls from height_fields that follow a spline, so that nearly seamless caves
can be made...I'm getting close to finishing it now (but it is nowhere near
perfect)
Andrew C
Andrew Clinton wrote:
> Hello,
>
> Is there any macro available that will perform on an object the same
> function as the look_at command does in a camera?
>
> In other words, I have an object at <0,0,0> and oriented in the +z
> direction, and I wish to perform an x-rotation then a y-rotation so that
> the object is now pointing at a given point (as in the look_at point for
> the Camera). I've been using John VanSickle's Reorient macro, but in
> some cases the object receives an undesireable z-rotation so that it
> becomes tilted wrong.
>
> I've been banging my head for a while about this, any help would be
> appreciated!
>
> Andrew C
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Fri, 17 Mar 2000 17:35:19 -0800 Andrew Clinton <cli### [at] ibm net>
wrote:
>btw, if anyone's interested, I'm working on a system that will create rock
>walls from height_fields that follow a spline, so that nearly seamless caves
>can be made...I'm getting close to finishing it now (but it is nowhere near
>perfect)
When you're ready, can you post demo images in p.binaries.images? TIA.
--
Alan - ako### [at] povray org - a k o n g <at> p o v r a y <dot> o r g
http://www.povray.org - Home of the Persistence of Vision Ray Tracer]
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I haven't seen this one listed:
#macro
v_lookat(P1,P2)<0,-degrees(asin(vnormalize(P2-P1).z)),degrees(asin(vnormalize(P2-P1).y))>#end
Andrew Clinton wrote:
>
> Wow, several stones can kill this one bird... I count 5 macros that do
> basically the same thing! Thanks for all your help, I got it solved.
>
> btw, if anyone's interested, I'm working on a system that will create rock
> walls from height_fields that follow a spline, so that nearly seamless caves
> can be made...I'm getting close to finishing it now (but it is nowhere near
> perfect)
>
> Andrew C
>
> Andrew Clinton wrote:
>
> > Hello,
> >
> > Is there any macro available that will perform on an object the same
> > function as the look_at command does in a camera?
> >
> > In other words, I have an object at <0,0,0> and oriented in the +z
> > direction, and I wish to perform an x-rotation then a y-rotation so that
> > the object is now pointing at a given point (as in the look_at point for
> > the Camera). I've been using John VanSickle's Reorient macro, but in
> > some cases the object receives an undesireable z-rotation so that it
> > becomes tilted wrong.
> >
> > I've been banging my head for a while about this, any help would be
> > appreciated!
> >
> > Andrew C
--
Mr. Art
"Often the appearance of reality is more important
than the reality of the appearance."
Bill DeWitt 2000
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |