POV-Ray : Newsgroups : povray.general : Oblique projection : Re: Oblique projection Server Time
31 Jul 2024 10:16:05 EDT (-0400)
  Re: Oblique projection  
From: Trevor G Quayle
Date: 4 Jan 2008 08:40:01
Message: <web.477e3710443d65d7c150d4c10@news.povray.org>
OK, I finally got this figured out, it was actually very simple once I looked at
the geometry involved.  This gives oblique projections of the x-y plane (-z
viewpoint).  Changing the value of DPTH toggles between cavalier and cabinet
projection:

//START
#declare AR=image_width/image_height; //Image aspect ratio (square pixels)
#declare VW=5;                        //Viewing width
#declare CD=6;                        //Cameras distance

#declare DPTH=1/(2*sqrt(2)); //Cabinet projection:  Depth = 0.5:1
#declare DPTH=1/(sqrt(2));   //Cavalier projection: Depth = 1:1

camera{
  orthographic
  location -z*CD
  up y*VW
  right x*VW*AR
  direction <-DPTH,-DPTH,1>
  translate  <CD*DPTH,CD*DPTH,0>
}

light_source{<100,300,-200> rgb 1}

box{-1,1 pigment {rgb 1}}

union{cylinder{0,x*2,0.02} cone{x*2,0.1,x*2.25,0} pigment{rgb <1,0,0>}}
union{cylinder{0,y*2,0.02} cone{y*2,0.1,y*2.25,0} pigment{rgb <0,1,0>}}
union{cylinder{0,-z*2,0.02} cone{-z*2,0.1,-z*2.25,0} pigment{rgb <0,0,1>}}
//END

-tgq


Post a reply to this message

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