POV-Ray : Newsgroups : povray.general : How do I set the position of the camera Server Time
6 Nov 2024 06:21:26 EST (-0500)
  How do I set the position of the camera (Message 1 to 1 of 1)  
From: Alan McFarlane
Subject: How do I set the position of the camera
Date: 25 Mar 1998 00:32:54
Message: <01bd57af$6cc6c0a0$990de8c3@default>
Given a scene with one object, and knowing in advance the objects size and
the size that the scene will be rendered to, how do I position the camera
so
that the entire object is visible?

//    sample code

// the Object_xxxx declares are generated by a separate utility
// and need not produce an object centered at <0,0,0>

#declare Object_MinX = -5
#declare Object_MinY = -1
#declare Object_MinZ = -0.25
#declare Object_MaxX = 5
#declare Object_MaxY = 1
#declare Object_MaxZ = 0.25

// could do with some ideas on how to position the light source(s) as well
light_source { ... }

// what should the vector some_location be?
// what should the float some_angle be?
camera
{
    location    some_location
    angle        some_angle
    look_at <
        (Object_MaxX-Object_MinX)/2+Object_MinX,
        (Object_MaxY-Object_MinY)/2+Object_MinY,
        (Object_MaxZ-Object_MinZ)/2+Object_MinZ, >
}

object
{
    Object
    texture { Object_Texture }
}

//    end sample

Thanks...
-- 
Alan McFarlane
amc### [at] bigfootcom


Post a reply to this message

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