|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
How would I rotate a sphere so that a certain point on the sphere would
point at location<x,y,z>?
--
camera{location<0,0.25,-2> look_at 0.5*y} #declare
T=texture{pigment{crackle scale 0.5 rotate 90 turbulence 0.75 color_map{[0
rgb 1][0.05 rgb 1][0.1 rgb<1,0.25,1>][0.25 rgbf 1][1 rgbf 1]}}
finish{ambient 1}} #declare c=difference{torus{0.5,0.1
rotate -90*x}box{<0.7,0,0.2>,<-0.7,-0.7,-0.2>}} merge{object{c
translate<0.5,0.5,0>} object{c translate<-0.5,0.5,0>}
cylinder{<1,0.5,0>,<1,0,0>,0.1} cylinder{<-1,0.5,0>,<-1,0,0>,0.1}
cylinder{0.5*y,0,0.1} texture{T}}
//Mahalis
--
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Do that same thing with a cylinder that starts in <0,0,0> and goes to x .
(or y or z, of course).
When you manage to do it with your cylin, you can be sure it will work with
the sphere as well, when the cylinder's edge can be the starting place for
the iris of the eye you've been working on.
First thing is to normalize the look_at vector , and figure out the
necessary transformations to reach it. Spherical coordinates (teta and phi)
will help, i presume.
Hope i've helped
Will
PS: We should thank Jacobi as well.
"Mahalis" <don### [at] fakeycom> escreveu na mensagem
news:3bc87a94@news.povray.org...
> How would I rotate a sphere so that a certain point on the sphere would
> point at location<x,y,z>?
>
> --
> camera{location<0,0.25,-2> look_at 0.5*y} #declare
> T=texture{pigment{crackle scale 0.5 rotate 90 turbulence 0.75 color_map{[0
> rgb 1][0.05 rgb 1][0.1 rgb<1,0.25,1>][0.25 rgbf 1][1 rgbf 1]}}
> finish{ambient 1}} #declare c=difference{torus{0.5,0.1
> rotate -90*x}box{<0.7,0,0.2>,<-0.7,-0.7,-0.2>}} merge{object{c
> translate<0.5,0.5,0>} object{c translate<-0.5,0.5,0>}
> cylinder{<1,0.5,0>,<1,0,0>,0.1} cylinder{<-1,0.5,0>,<-1,0,0>,0.1}
> cylinder{0.5*y,0,0.1} texture{T}}
> file://Mahalis
> --
>
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mahalis wrote:
>
> How would I rotate a sphere so that a certain point on the sphere would
> point at location<x,y,z>?
Mahalis wrote:
>
> How would I rotate a sphere so that a certain point on the sphere would
> point at location<x,y,z>?
You can find the code for my ReorientMatrix() macro here:
news://news.povray.org/3B8ECB7D.571A4BE2%40hotmail.com
(In my reply to Dave Dunn's "Vexing Vector Problem" 31. Aug.)
And then you may write something like this:
#declare YourSphere = ... // You specify
#declare vPointOnSphere = ... // You specify
#declare vPointAtLocation = <LocX, LocY, LocZ>;
object {
YourSphere
ReorientMatrix(vPointOnSphere, vPointAtLocation)
}
Hopefully this will do the trick for you.
(My ReorientMatrix() macro does the same as
John Van Sickle's Reorient() macro, but with
a slightly different method.)
Tor Olav
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mahalis <don### [at] fakeycom> wrote:
: How would I rotate a sphere so that a certain point on the sphere would
: point at location<x,y,z>?
If you have pov3.5 beta, look at the include files documentation for that.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Uh-hah. Could someone give me an example of how to use the vnormalize()
function? The POV 3.1 docs aren't too clear on that.
--
camera{location<0,0.25,-2> look_at 0.5*y} #declare
T=texture{pigment{crackle scale 0.5 rotate 90 turbulence 0.75 color_map{[0
rgb 1][0.05 rgb 1][0.1 rgb<1,0.25,1>][0.25 rgbf 1][1 rgbf 1]}}
finish{ambient 1}} #declare c=difference{torus{0.5,0.1
rotate -90*x}box{<0.7,0,0.2>,<-0.7,-0.7,-0.2>}} merge{object{c
translate<0.5,0.5,0>} object{c translate<-0.5,0.5,0>}
cylinder{<1,0.5,0>,<1,0,0>,0.1} cylinder{<-1,0.5,0>,<-1,0,0>,0.1}
cylinder{0.5*y,0,0.1} texture{T}}
//Mahalis
--
"Wilson Reis" <wil### [at] ismcombr> wrote in message
news:3bc87e5c@news.povray.org...
> Do that same thing with a cylinder that starts in <0,0,0> and goes to x .
> (or y or z, of course).
>
> When you manage to do it with your cylin, you can be sure it will work
with
> the sphere as well, when the cylinder's edge can be the starting place for
> the iris of the eye you've been working on.
>
> First thing is to normalize the look_at vector , and figure out the
> necessary transformations to reach it. Spherical coordinates (teta and
phi)
> will help, i presume.
>
> Hope i've helped
> Will
> PS: We should thank Jacobi as well.
>
>
>
>
> "Mahalis" <don### [at] fakeycom> escreveu na mensagem
> news:3bc87a94@news.povray.org...
> > How would I rotate a sphere so that a certain point on the sphere would
> > point at location<x,y,z>?
> >
> > --
> > camera{location<0,0.25,-2> look_at 0.5*y} #declare
> > T=texture{pigment{crackle scale 0.5 rotate 90 turbulence 0.75
color_map{[0
> > rgb 1][0.05 rgb 1][0.1 rgb<1,0.25,1>][0.25 rgbf 1][1 rgbf 1]}}
> > finish{ambient 1}} #declare c=difference{torus{0.5,0.1
> > rotate -90*x}box{<0.7,0,0.2>,<-0.7,-0.7,-0.2>}} merge{object{c
> > translate<0.5,0.5,0>} object{c translate<-0.5,0.5,0>}
> > cylinder{<1,0.5,0>,<1,0,0>,0.1} cylinder{<-1,0.5,0>,<-1,0,0>,0.1}
> > cylinder{0.5*y,0,0.1} texture{T}}
> > file://Mahalis
> > --
> >
> >
> >
>
>
>
>
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|