POV-Ray : Newsgroups : povray.newusers : Finding extents of an object : Re: Finding extents of an object Server Time
26 Sep 2021 21:54:48 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.
http://news.povray.org/58475e0a%241%40news.povray.org

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

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:

http://news.povray.org/povray.binaries.images/thread/%3C5d95e6c3%241%40news.povray.org%3E/

-Bill


Post a reply to this message

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