|
|
Among the many thousands of things about povray that I don't seem to
understand appears to be use of the vector macros.
I want to create a cylinder along the x-axis with one end at 0,0.
move it to <location>, pointed at <lookat>.
I /think/ I am doing the following:
1) find angle between <location> and <lookat> using VAngleD.
2) rotate the cylinder using that result.
3) translate to <location>
Well, the cylinder doesn't appear to be rotating at all!
Probably something foolish that I am overlooking in the middle of the night.
Any help appreciated!
Alan Walkington
------------------
#include "colors.inc"
#include "math.inc"
light_source {
0*x
color White * 2
translate <10, 20, 30>
}
plane {y, -1.0 pigment {color Gray65}}
camera {
orthographic
location <0, 10,0>
look_at <0,0,0>
}
#macro Cylinder (Location, Lookat)
#local len = VDist(Location, Lookat);
cylinder {
<0,0,0>
<-len/2, 0, 0>
.25
pigment {color LightBlue}
rotate VAngleD(Location, Lookat)
translate Location
}
#end
#declare Loc = <-2,0,2>;
#declare Look = <2,0,-2>;
// some markers
sphere {
Loc .5
pigment {color Red}
}
sphere {
Look .5
pigment {color Green}
}
// and the cylinder
Cylinder(Loc, Look)
Post a reply to this message
|
|
|
|
Alan Walkington wrote:
>
> Among the many thousands of things about povray that I don't seem to
> understand appears to be use of the vector macros.
>
> I want to create a cylinder along the x-axis with one end at 0,0.
> move it to <location>, pointed at <lookat>.
>
> [...]
You need to do a Reorient_Trans() with 'x' and '<lookat>-<location>' as
parameters and then translate the object to <location>.
Christoph
--
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 28 Feb. 2003 _____./\/^>_*_<^\/\.______
Post a reply to this message
|
|