POV-Ray : Newsgroups : povray.general : Width of line Server Time
27 Nov 2024 03:25:46 EST (-0500)
  Width of line (Message 1 to 3 of 3)  
From: twister
Subject: Width of line
Date: 8 Apr 2009 07:45:00
Message: <web.49dc8df95dd63425c9ee64130@news.povray.org>
Hello,
I was given a povray script with some predefined settings. I have written a
#macro that draws a line (of some width W) according to scenario:
1. take i-th point of line
2. take (i+1)-th point of line
3. take (i+2)-th point of line
4. caclulate vector V1 from points i, i+1
5. caclulate vector V2 from points i+1, i+2
6. calculate perpendicular right vectors V1p and V2p
7. calculate new right point using point i and vector V1p
8. calculate new right point using point i+1 and vector V2p
9. draw polygon with prism
10. Increment i
11. goto 1.

Basically everything works fine but when a line goes straight and than turns I
can see the bigger width of line in the turn area than in straight area. It
looks something is wrong with the camera settings because when the camera is
located right obove the line and is looking from the top (90 degrees to the
line surface) everything looks good. Usually camera is located in other point
so looking vector is not perpendicular to the line surface.

Camera settings look like this:
camera {
  location  <-5000, 25000,  -40000>
  direction 13 * z
  up        24 * y
  right     36 * x
  look_at   <-5000, -7000, -10000>
}

I know up and right parameters may influence the content of the view they are
set somehow properly for image (600x400 - 1.5 ratio, 36/24 - 1.5 ratio)

Is there a way to check what is going on?

Regards,
twister


Post a reply to this message

From: Tim Attwood
Subject: Re: Width of line
Date: 9 Apr 2009 00:19:31
Message: <49dd7753$1@news.povray.org>
That seems like a lot of calculating just to draw a line.
Typically if I want a line I'd just use a sphere at
each point, and a cylinder in-between them. If you
need them to be flat, then just use the tube as an
object pattern on a flat plane.

 pigment {
    object {
       tubeLine 
       color White 
       color Black
    }
 }


Post a reply to this message

From: twister
Subject: Re: Width of line
Date: 16 Apr 2009 03:50:00
Message: <web.49e6e21b20b21bdac9ee64130@news.povray.org>
Thanks for a tip, but rendering duration is not a biggest problem here. Could
someone explain me how camera settings (as above) may influence the object
dimensions to the camera location?

In my example if the line goes along z-axis it has a proper width, but when it
goes e.g. as a function x - z = 0 then its width is doubled. The effect can be
seen only if camera is looking at some angle to the X-Z plane (line plane).
When the camera is looking perpendicular then width of line is right for all
cases.

Thanks in advance,
twister


Post a reply to this message

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