POV-Ray : Newsgroups : povray.newusers : VAngleD(V1, V2) : VAngleD(V1, V2) Server Time
4 Sep 2024 22:17:20 EDT (-0400)
  VAngleD(V1, V2)  
From: Tim McMurdo
Date: 14 Jul 2002 20:11:28
Message: <3d321330@news.povray.org>
I am using the function VAngleD(V1, V2) to orient some rigging on my USS
Niagara WIP. However, I am getting some unexpected results. Here is my code:

        union{
                //Spanker Boom Guy

                #declare X1 = 286.21;
                #declare Z1 = 0;
                #declare Y1 = 1472.4;
                #declare X2 = cos(radians(BoomRotate))*10554.5;
                #declare Z2 = sin(radians(BoomRotate))*10554.5;
                #declare Y2 = sin(radians(2))*10554.5;
                #declare X3 = sin(radians(BoomRotate))*150;
                #declare Z3 = cos(radians(BoomRotate))*150;
                #declare Y3 = 0;
                #declare X4 = X1+X2-X3;
                #declare Z4 = Z1+Z2+Z3;
                #declare Y4 = Y1+Y2-Y3;
                union{
                        cylinder{<-12.5,0,25>,<-12.5,0,50>, 12.5 }
                        cylinder{<0,0,0>,<0,0,50>, 12.5 }
                        torus{50,12.5 scale<0.5,1,1>
rotate<0,0,0>translate<0,0,75> }
                        object{DHookBlock12mm rotate<90,0,-90>
translate<0,0,400>}
                        cylinder{<-30,40,300>,<-12.5,40,1200>, 12.5 }
                        #declare Length = VDist(<-X4-4000,Y4,Z4>,
<-15000,75,2435>);
                        sphere{<0,0,Length>,50 pigment{Green}}
                        texture{WhiteRopeTexture rotate<90,0,0>}
                        rotate VAngleD(<-X4-4000,Y4,Z4>, <-15000,75,2435>)
                        translate<-X4-4000,Y4,Z4>
                }


        }


If I understand the function correctly, the line

rotate VAngleD(<-X4-4000,Y4,Z4>, <-15000,75,2435>)

should orient point from vector <-X4-4000,Y4,Z4> to vector <-15000,75,2435>.

The documentation is sparse. Could someone let me know if I am using the
vector function correctly. If not, I would appreciate some sample code
showing how it is used.

Thanks,

Tim


Post a reply to this message

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