POV-Ray : Newsgroups : povray.newusers : Finding extents of an object : Re: Finding extents of an object Server Time
13 Jul 2024 08:32:07 EDT (-0400)
  Re: Finding extents of an object  
From: Bald Eagle
Date: 15 Jun 2021 13:45:00
Message: <web.60c8e703dcabb5001f9dae3025979125@news.povray.org>
Herbert Pflaum <nospam@invalid> wrote:
> Hi there,
> I would like to render an object using POV-Ray and it works nicely for
> the most part. The issue is that I have varying objects that I'm
> rendering (the POV-Ray source is generated) and they are varying in
> their position and size. I always view them in orthographic projection

Well, the orthographic projection makes it easy.

So what I would do is define your object at the origin, and put your camera at
z=10, then rotate your object -y*45 and -x*45 to simulate the way it will look
with the camera in the proper location.   That will give you an axis-aligned
bounding box which will tell you how many pov-units wide and high it is in that

Then you can either use the scene as it is and calculate an appropriate "zoom"
value, or undo the rotations and then move your camera to xyz*10

make sense?

You may have to perform additional adjustments using a translation if your
objects are not symmetrical and centered on the origin.

> This works fairly well but I would like the rendering output to be so
> that the object is not clipped but also takes up most of the screen real
> estate. I do this currently by manually varying the "angle" operator
> (i.e., for small objects, small angle and for large objects a large angle).
> I want this do be done automatically but I don't know where to start.
> Any hints on how to achieve this?

Just in case you're interested, there was a thread on doing this with the
perspective camera as well:



Post a reply to this message

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