POV-Ray : Newsgroups : povray.newusers : shapes and colors : Re: shapes and colors Server Time
28 Jul 2024 18:23:40 EDT (-0400)
  Re: shapes and colors  
From: JetRacer
Date: 1 Dec 2007 15:50:00
Message: <web.4751c82ae3788ac5278fa6d50@news.povray.org>
"Thanu" <nomail@nomail> wrote:
> Is there a way to fill a shape with one color and give the shape's outer line a
> different color?
>
> ex: I need to have a blue color box with its lines(which show the edges of the
> shape surfaces) in red color.

You mean an outline or a wireframe?

A wireframe is best made using cylinders. The clever way is to defign the
cylinder thickness as:

Thickness*VDist(CameraLocation, ObjectLocation)/image_height

Thickness should be replaced with your radius value in pixels. Note that
"image_height" is a built-in Pov-Ray function (don't replace it with a number).
This is obviusly not fool-proof. Using cones (individually calculated ends
radius) would fix most problems asociated with closeups and wide angle cameras.

If you want an outline in Pov-Ray then it's simply not humanly possible and you
better go with the image processor option as stated above. The clever way to do
that is to make a copy of the original scene and modify it so all outlined
object(s) are presented as white with ambient 1 diffuse 0 and everything not
outlined as black. Use RGB component colors instead of white to support
overlapping objects (so you don't have to play around with multiple files, just
copy from the channels).

Hint: in my book "not humanly possible" includes a scheme to use object pattern
with a rotated box and transparency presented on a polygon square. Which
probably won't work in practic either :(

If edge detect doesn't play nice then you may want to try blur and levels then
eliminate the "bleeding in" by re-introducing the original as a screen layer
(aka "additive").


Post a reply to this message

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