POV-Ray : Newsgroups : povray.general : Problem with orthographic camera : Re: Problem with orthographic camera Server Time
29 Nov 2024 19:01:11 EST (-0500)
  Re: Problem with orthographic camera  
From: povray
Date: 2 Sep 2005 10:50:22
Message: <2233.43186608.9052f@localhost>
KalleK wrote:
> Hi!
> 
> I wanted to cut a "pyramid without a top" out of a box. This is for a
> backround of a game so I used an orthographic camera.
>  But the shading is all wrong. To show the problem, I squeezed the
> prism to have a really shallow angle (see the scale-statement in the
> prism), so nearly no difference in the shading of the box and the cutted
> out surface should be visible. Uncommenting the first three lines in the
> camera-statement shows the problem.
> 
> On a sidenote, if you change the perspective camera to a location 37000
> y-units far away, and an angle of 1, the problem is turned around. (I
> guess, this is due to precision problems... - But there are no gigantic
> numbers in the orthographic case.)
> 
> My POV-Ray Version is 3.6.1.icl8 on WinXPSP2
> Any Ideas?
> Thank you!
> Kalle
> 
> //Sourcecode starts here
> 
> camera {
> //  orthographic
> //  right <650,0,0>
> //  up <0,490,0>
>   location <320,500,240>
>   look_at <320,000,240>
> }
> 
> difference {
>   box {<0,-1,0>,<1+1/3,0,1>}
>   prism {
>     conic_sweep
>     1.1,0.8,4
>     <-0.5,0.5>,<-0.5,-0.5>,<0.5,-0.5>,<0.5,0.5>
>     translate -y
>     scale <1,.000005,1>
>     translate y
>     translate <0.5,-1,.5>
>   }
>   pigment { green 1 }
>   scale 480
> }
> 
> light_source {
>   <240,500,-240>
>   color rgb 1
> }
> 
> 

You've run into a pitfall with look_at.  Pointing the
camera directly up or down that way gets it confused.
Better to *not* use look_at and do this instead:

camera {
   orthographic
   locatation <0, 0, 0>
   direction <0, 0, 1>
   right <650,0,0>
   up <0,490,0>
   rotate x*90 // point camera down
   translate <320, 500, 240> // move camera where you want it
//  location <320,500,240>
//  look_at <320,000,240>
}


It might be x*-90 ... I always forget.
This way you retain a mathematically "pure"
vertical.

-- 
to all the companies who wait until a large user base becomes
dependant on their freeware, then shafting said happy campers with
mandatory payment for continued usage. I spit on your grave.


Post a reply to this message

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