POV-Ray : Newsgroups : povray.newusers : curious: degenerate triangles and cameras : Re: curious: degenerate triangles and cameras Server Time
28 Jul 2024 14:33:48 EDT (-0400)
  Re: curious: degenerate triangles and cameras  
From: Chris B
Date: 21 Feb 2009 04:25:01
Message: <499fc86d$1@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote in message 
news:web.499f887226995c43f50167bc0@news.povray.org...
> "joost_1972" <joo### [at] hotmailcom> wrote:
>>
>> Secondly I was wondering if there is an option to choose different camera 
>> angles
>> like there is the pull down menu for choosing the resolutions. Now 
>> changing
>> camera angles involves editing the code constantly (adding and removing 
>> // in
>> my case).
>>

Another alternative is to name the different camera positions you want to 
use in the scene and store the settings for each position (camera settings, 
lighting, variable settings etc.) in a little macro/switch statement using 
the strcmp function. You could put it in a separate file if you wish to keep 
your main scene file tidy. The added advantage of this is that you can set 
variables to perform functions in the scene, such as opening/closing doors 
or conditionally removing objects from the scene if they would otherwise 
block the camera. For example:

#include "myscene_cameras.inc"
MyCamera("Top")

Then "myscene_cameras.inc" would just contain the macro:

#macro MyCamera(CameraAngle)
  #switch (0)
  #case (strcmp(CameraAngle,"Front"))
    camera {location <0,1.8,-2> look_at <0,0,0> angle 110}
    light_source {<-10,10,-35>, rgb 1}
  #break
  #case (strcmp(CameraAngle,"Top"))
    camera {location <0,4.8,-0.001> look_at <0,0,0> angle 50}
    light_source {<-10,10,-35>, rgb 1}
  #break
  #case (strcmp(CameraAngle,"Inside"))
    camera {location <0,0,0.001> look_at <0,0,0> angle 180}
    light_source {<0,0,>, rgb 1}
  #break
  #else
    camera {location <-1,1,0> look_at <0,0.5,0> }
    light_source {<10,10,-35>, rgb 1}
  #end
#end

When you set up a new scene it's a quick job to copy the file and adjust the 
settings for that new scene.

Regards,
Chris B.


Post a reply to this message

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