POV-Ray : Newsgroups : povray.general : Aligning objects programatically : Re: Aligning objects programatically Server Time
2 Aug 2024 20:18:22 EDT (-0400)
  Re: Aligning objects programatically  
From: Dave VanHorn
Date: 28 Jul 2004 19:53:45
Message: <41083c89$1@news.povray.org>
The challenge is to get the correct x-coordinate fot the text object so it
is centered relative to the sphere.  So far, all I know how to do is
adjust the x coordinate by trial-and-error.  Is there some way to obtain
the size of the text programatically and set it's location using an
expression?

This is a bit of a peeve of mine, with how the primitives in pov are done.

Spheres have their centers at 0,0,0.
Cubes start with one corner at 0,0,0, and go to the opposite corner at 1,1,1
so the natural center is at 0.5, 0.5, 0.5

You have to think ahead, and locate the center of the object where it makes
sense.
For some things, it's the geometric center, others it will be the center of
"mass", or some other point, depending on how it's used in the scene. and
combined with other objects.

If you defined a washer (as in hardware store) you'd probably want one face
to sit at 0,0,0, and the other at 0,(0+Washer_Thickness), 0  so that you
could put it at 0,0+Cube_High,0 and have it sitting on top of the cube,
rather than IN the cube, or just above the cube.


Post a reply to this message

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