POV-Ray : Newsgroups : povray.general : Always on top : Re: Always on top Server Time
1 Aug 2024 20:13:38 EDT (-0400)
  Re: Always on top  
From: Ger
Date: 25 Apr 2005 06:27:33
Message: <426cc615@news.povray.org>
Slime wrote:

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

Actually, there is a very simple, although laborious, way of doing a thing
like this.

First render your scene without the object you want to be "allways on top"
Second render the "allways on top" object with all the lighting from the
first render. If you make the second render with alpha channel on you can
then overlay the second render on the first one. This also works when
creating animations.
In the second render you can not use things like fog because this will
obscure the first render fully.

-- 
Ger


Post a reply to this message

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