|
|
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
|
|