POV-Ray : Newsgroups : povray.general : Always on top : Re: Always on top Server Time
1 Aug 2024 20:10:17 EDT (-0400)
  Re: Always on top  
From: Slime
Date: 24 Apr 2005 19:10:43
Message: <426c2773$1@news.povray.org>
> is there a way to tell povray to keep an object "always on top" like it is
> possible in OpenGL?

Not really, since POV-Ray doesn't work with a depth buffer like OpenGL
does... if an object is behind another one, it will be shown that way.

One possibility, if the given object is simple, is to create an object which
is the projection of the object in question from the camera's position, and
then difference that from everything else, cutting a hole all the way to the
object. But that's pretty difficult.

> I could also try
> to move the "always on front" object further towards the camera, but since
> i generally have a lot of objects and my files are generated automaticaly
> thats also not really an option.

This, however, probably is your best option, (unless you need the objects to
respond to lighting as though they hadn't been moved), and it should be
doable:

Take the objects that need to be in front of the camera, and put them in a
union{}. Translate this union by the opposite of the camera position (for
instance, if the camera is at <-2,3,4>, translate the union by <2,-3,-4>).
Then scale it very small (scale .001 or something like that), and then
translate it back (translate <-2,3,4>). This will pull the objects closer to
the camera.

Another option is to determine where the objects should appear on the
screen, and then place them there with screen.inc.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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