POV-Ray : Newsgroups : povray.general : Unexpected results with prisms : Re: Unexpected results with prisms Server Time
31 Jul 2024 22:13:33 EDT (-0400)
  Re: Unexpected results with prisms  
From: Chris B
Date: 25 Aug 2006 04:04:59
Message: <44eeaf2b$1@news.povray.org>
"clum" <nomail@nomail> wrote in message 
news:web.44eea9b5cc351d989bc721f00@news.povray.org...
> Oops, don't ask why I put it in a difference, I was doing a more 
> complicated
> example before. Now that part can be deleted.
>
> "clum" <nomail@nomail> wrote:
>> I've been doing various things with conic-swept prisms, and I've been
>> getting some very unexpected results. I tried reducing my problem to a
>> simpler scene file, and though it did not come up with exactly the same
>> unexpected results as before, it's still not working as I expected. Here 
>> is
>> a simple example. With a normal perspective camera, it is a nice square
>> pyramid. With a directly overhead orthogonal view, however, the whole 
>> thing
>> appears green. Though I am not sure, from my previous experimentation I
>> believe that only the base is appearing, and not the walls of the 
>> pyramid,
>> similar to results one receives when using back-face culling with 
>> reversed
>> normals.
>>
>> //camera {location <5, 7, 2> look_at <1,0,0>}
>> camera {orthographic location <0, 10, 0> look_at <0, 0, 0> up x*3 right 
>> z*4}
>> light_source {<5,5,5> rgb 1}
>>
>> difference {
>>     prism {
>>         conic_sweep
>>         linear_spline
>>         0, 1, 5,
>>         <-1, 1>, <1, 1>, <1, -1>, <-1, -1>, <-1, 1>
>>         scale <1, -1, 1>
>>         translate y*1
>>     }
>>
>>     pigment {
>>         gradient y
>>
>>         color_map {
>>         [0.0 color <0, 1, 0> ]
>>         [1 color <0, 0, 1> ]
>>         }
>>         scale y*.2
>>     }
>>     finish {ambient .5}
>> }
>
>
Hi Clum,

If you change the camera to
  camera {orthographic location <0.0000001, 100, 0> look_at <0, 0, 0> up x*3 
right z*4}
it should fix this particular problem (possibly not some of the others you 
elude to).

I can't recall the exact reason for this problem, but it's to do with having 
the camera directly over the look_at point, which I think used to raise an 
error in earlier versions of POV-Ray. I think it's something to do with 
divide-by-zero errors that arise quite a lot when calculating for that 
particular condition.

Regards,
Chris B.


Post a reply to this message

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