POV-Ray : Newsgroups : povray.newusers : Problems with orthographic camera. Server Time
30 Jul 2024 02:28:58 EDT (-0400)
  Problems with orthographic camera. (Message 1 to 2 of 2)  
From: Stephen
Subject: Problems with orthographic camera.
Date: 29 Sep 2004 05:50:00
Message: <web.415a85192974646171087b900@news.povray.org>
I am trying to make a spark generator and noticed this behaviour in Pov-Ray
3.5 and 3.60.
At the end of the code I draw the spark, a set of cylinders generated by a
#while loop.
Using an orthographic camera the objects are only visible when the camera
angle is greater than 3.053 degrees (from the location I am using). As I
reduce the camera angle first the cylinders disappear then a sphere I am
using as an emitter disappears. I thought this might be due to the
behaviour described in 6.4.2.2  Orthographic projection. But if I comment
out the drawing of the cylinders, the sphere reappears.
Can anyone explain it? Also this is very much a WIP and as you will see from
my code (I flatter myself calling it code) I am no programmer. Any
suggestions as to how I can improve it will be very welcome.

In anticipation
 Stephen


Post a reply to this message

From: Stephen
Subject: Re: Problems with orthographic camera.
Date: 29 Sep 2004 06:15:00
Message: <web.415a8ae2a15be07e71087b900@news.povray.org>
"Stephen" <mca### [at] hotmailcom> wrote:
> I am trying to make a spark generator and noticed this behaviour in Pov-Ray
> 3.5 and 3.60.
[snip]

Arrg! I forgot the script :-{

#include "colors.inc"
global_settings { assumed_gamma 2.2
max_trace_level 20}

camera {

        orthographic
    location  < 0.0, 0, -25 >
    direction <0,  0,   1>
    up        <0,  1,   0>
    right   <4/3,  0,   0>
    look_at <0.0, 0, 0>

//    angle 3.052       // Sphere and cylinders not Visible with
orthographic camera
//    angle 3.053         // Sphere Visible cylinders not Visible with
orthographic camera
    angle 3.054         // Sphere and cylinders Visible with orthographic
camera

}

light_source {<30, 20, 0> colour White }

sphere  {<0,0,0,> 0.02
  pigment {  color White }
  finish  {
  reflection {1.0}
   phong 0.1
   ambient 0.5
   diffuse 0.7
   }
  }

sky_sphere {
    pigment {
        gradient y
        color_map {
            [0.0 Gray40 ]
            [0.5 Gray10 ]
            [1.0 Gray40 ]
        }
    }
}

//////   Setting up variables

#declare R1 = seed(123457);
#declare  T_Base = 20;
#declare  Time_Count = 1;
#declare Particle_pos = array[3] [T_Base+1]
#declare Updown = 0;
#declare Y_Scale = .05;
#declare Particle_pos [0] [0]   = 0    ;
#declare Particle_pos [1] [0]   = 0    ;
#declare Particle_pos [2] [0]   = 0    ;

//////  Setting up weighting

#declare  Time_Count = 1;
#while  (Time_Count <= T_Base)

        #switch (Particle_pos [1][(Time_Count - 1)])  //
#range(-10, -0.9)
#declare Updown  = 0.1 * Y_Scale ;
 #break
#range(-0.8999, -0.8)
#declare Updown  = (rand(R1)-.1)*Y_Scale  ;
 #break
#range(-0.7999, -0.7)
#declare Updown  = (rand(R1)-.2)*Y_Scale  ;
 #break
#range(-0.6999, -0.6)
#declare Updown  = (rand(R1)-.3)*Y_Scale  ;
 #break
#range(-0.5998, -0.5)
#declare Updown  = (rand(R1)-.4)*Y_Scale  ;
 #break
#range(-0.4999, 0.5)
#declare Updown  = (rand(R1)-.5)*Y_Scale  ;
 #break
#range(0.5001, 0.6)
#declare Updown  = -(rand(R1)-.6)*Y_Scale  ;
 #break
#range(0.6001, 0.7)
#declare Updown  = -(rand(R1)-.7)*Y_Scale  ;
 #break
#range(0.7001, 0.8)
#declare Updown  = -(rand(R1)-.8)*Y_Scale  ;
 #break
#range(0.8001, 0.9)
#declare Updown  = -(rand(R1)-.9)*Y_Scale  ;
 #break
#range(0.9001, 10)
#declare Updown  = -1 * Y_Scale  ;
 #break

 #else
#declare Updown  = Updown  ;


         #end

//////          Working out out cylinder positions

#declare Particle_pos [0] [Time_Count]   = (Particle_pos [0] [Time_Count
-1]) + 1/T_Base   ;


#if (Time_Count > (0.75*T_Base)&Time_Count < (0.95*T_Base))
        #declare Particle_pos [1] [Time_Count]   = (Particle_pos
[1][Time_Count-1]+(Updown*1))/1.25     ;
        #else
#declare Particle_pos [1] [Time_Count]   = (Particle_pos
[1][Time_Count-1]+(Updown*1))/1.75     ;

#end
#if (Time_Count <= (0.75*T_Base))
        #declare Particle_pos [1] [Time_Count]   = Particle_pos
[1][Time_Count-1]+Updown     ;
#end

#declare Particle_pos [2] [Time_Count]   = 0     ;


        #declare Time_Count = Time_Count +1;


#end
#declare  Time_Count = T_Base;

//////  Drawing the cylinders

//*                                              // Coment this section out
and sphere is visible
#while  (Time_Count > 0)

cylinder{
      <Particle_pos [0][Time_Count-1] ,Particle_pos [1][Time_Count-1]
,Particle_pos [2][Time_Count-1] >,
      <Particle_pos [0][Time_Count] ,Particle_pos [1][Time_Count]
,Particle_pos [2][Time_Count] > , 0.01
        pigment {  color White }
      }
         #declare Time_Count = Time_Count -1;

#end

//*/


Post a reply to this message

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