To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 6732
6731  |  6733
Subject: 
Re: Can LDGLite print the current orientation matrix? (feature request)
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 17 Jan 2002 23:41:26 GMT
Viewed: 
1947 times
  
Don Heyse wrote...
> [snip], but I don't completely understand the
> STEREO stuff in the location part of an l3p camera setting.  Can you
> or somebody explain it?  I can create an ordinary location line like
> this:
> 
>    location <cx,cy,cz> +PCT/100.0*<dx,dy,dz>
> 
> where <cx,cy,cz> is the camera location and <dx,dy,dz> is the distance
> from the camera to the look_at point, but l3p adds that STEREO part and
> that's where I get lost.
> 
>    location vaxis_rotate(<cx,cy,cz> +PCT/100.0*<dx,dy,dz>,
>                          <ax,ay,az>,STEREO)

If STEREO is zero (the default), then there's no rotation, and it's the same as
   location <cx,cy,cz> +PCT/100.0*<dx,dy,dz>

> According to the POV docs <ax,ay,az> is an axis (through the origin?)
> and STEREO is the number of degrees to rotate about that axis.  Fine,
> but how does this work, since I'm not necessarily looking at the
> origin with the look_at statement.  Am I missing something?  Help!

No, *I* seem to have missed something...
It takes four numbers to determine a vector in space, so <ax,ay,az> must
obviously be through origin. Because I usually build my models around origin
(it worked best like that with LEdit/LDraw) I didn't notice the error while testing...

You have to translate the look_at point to the origin before rotating the location
around the vector (the vector is perpendicular to the location-look_at and lies
in the sky - location-look_at plane)

The camera definition in the coming was already under revision to become
more readable (I hope), and I have now corrected the stereo part:

camera {
   #declare PCT = 0; // Percentage further away
   #declare STEREO = 0; // Normal view
   #declare L3BetweenEyes = 1/12; // Distance between eyes (stereo cameras) typically 1/12 of distance to model
   //Uncomment either two lines below to make stereo images
   //#declare STEREO = -degrees(atan2(L3BetweenEyes,1))/2; // Left view
   //#declare STEREO =  degrees(atan2(L3BetweenEyes,1))/2; // Right view
   #declare L3Location = <42.2688,-38.6915,-42.2688>;
   #declare L3LookAt = <0.251318,-4.38439,-0.251318>; // Calculated (not -cla)
   #declare L3Location = L3Location + PCT/100.0*(L3Location-L3LookAt);

   #if (STEREO = 0)
      location L3Location
   #else
      location L3LookAt + vaxis_rotate(L3Location-L3LookAt, <-0.353553,-0.866025,0.353553>, STEREO)
   #end
   sky      -y
   right    -4/3*x
   look_at  L3LookAt
   angle    67.3801
   rotate   <0,1e-5,0> // Prevent gap between adjecent quads
   //orthographic
}

BTW: Google gave this great link on vaxis_rotate:
http://www.spiritone.com/~english/cyclopedia/vaxis.html
/Lars



Message is in Reply To:
  Re: Can LDGLite print the current orientation matrix? (feature request)
 
(...) Ok the current copy of main.c in CVS has a function that does part A. I have most of part B working, but I don't completely understand the STEREO stuff in the location part of an l3p camera setting. Can you or somebody explain it? I can create (...) (25 years ago, 8-Jan-02, to lugnet.cad.dev)

13 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR