POV-Ray : Newsgroups : povray.newusers : Polygons in a 3D plane? Server Time
5 Nov 2024 03:18:09 EST (-0500)
  Polygons in a 3D plane? (Message 1 to 7 of 7)  
From: Snowman
Subject: Polygons in a 3D plane?
Date: 11 Mar 2001 18:59:54
Message: <3aac117a$1@news.povray.org>
In POV-Ray, you are allowed to input 3 coordinates when using the triangle
function. Thus, the triangle can be rotated and placed in any three
dimensional plane without using the rotate function.
Can you do the same to a polygon so that it lies in any plane you choose. I
have tried doing this without success so far. I understand that all the
points would need to fall on that plane.
Thanks for the help.


Post a reply to this message

From: Snowman
Subject: Re: Polygons in a 3D plane?
Date: 11 Mar 2001 19:12:12
Message: <3aac145c$1@news.povray.org>
Maybe I should have explained better:
I am trying to create shapes in a 3D plane without using triangles, i.e. its
a lot easier to program 1 pentagon than 5 triangles.


Post a reply to this message

From: Spock
Subject: Re: Polygons in a 3D plane?
Date: 11 Mar 2001 19:31:07
Message: <3aac18cb@news.povray.org>
Correct me if I am wrong, but I think the triangle and the plane are the
only 2D shapes that can be rendered by POV, regardless of orientation.

Perhaps you could use CSG to hack interesting shapes out of a plane (I don't
know if this is possible)...  but I think my brain would overload if I tried
this in arbitrary 3-space.  Might be better to carve the plane while it is
lying flat and then move it into place.

In the specific example you describe I would build the pentagon out of
triangles and encode everything in a macro to minimize the impact on my
other code.  You might choose to pass the centre, normal, and radius to the
macro to provide one-stop shopping.

"Snowman" <sno### [at] somewherecom> wrote in message
news:3aac145c$1@news.povray.org...
> Maybe I should have explained better:
> I am trying to create shapes in a 3D plane without using triangles, i.e.
its
> a lot easier to program 1 pentagon than 5 triangles.
>
>


Post a reply to this message

From: Chris Huff
Subject: Re: Polygons in a 3D plane?
Date: 11 Mar 2001 20:10:04
Message: <chrishuff-668023.20061811032001@news.povray.org>
In article <3aac18cb@news.povray.org>, "Spock" <spo### [at] nospamcom> 
wrote:

> Correct me if I am wrong, but I think the triangle and the plane are the
> only 2D shapes that can be rendered by POV, regardless of orientation.

You're wrong...the 2D surfaces POV supports are triangles (including 
smooth_triangles), discs, and polygons. It also has bicubic_patches, but 
even though they are infinitely thin, they are curved in 3 dimensions, 
not restricted to a 2D plane.
Plane objects are not 2D, but infinite 3D surfaces. They divide the 
"universe" into 2 halves, one is "inside" the plane.


> Perhaps you could use CSG to hack interesting shapes out of a plane 
> (I don't know if this is possible)...  but I think my brain would 
> overload if I tried this in arbitrary 3-space.  Might be better to 
> carve the plane while it is lying flat and then move it into place.

Not with CSG (unless you wanted a polygon with thickness), but you could 
try using clipped_by to do it.


> In the specific example you describe I would build the pentagon out 
> of triangles and encode everything in a macro to minimize the impact 
> on my other code.  You might choose to pass the centre, normal, and 
> radius to the macro to provide one-stop shopping.

This would probably be the easiest way to do it.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Warp
Subject: Re: Polygons in a 3D plane?
Date: 11 Mar 2001 20:49:32
Message: <3aac2b2c@news.povray.org>
Snowman <sno### [at] somewherecom> wrote:
: I am trying to create shapes in a 3D plane without using triangles, i.e. its
: a lot easier to program 1 pentagon than 5 triangles.

  You'll probably get a performance boost by using triangle meshes instead
of polygons anyways, so don't be so scared of using triangles to form
more complex polygons (although I'm not sure how povray handles polygons).
  As someone already suggested, making helping macros is a good idea.

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

From: John VanSickle
Subject: Re: Polygons in a 3D plane?
Date: 12 Mar 2001 01:46:25
Message: <3AAC716B.178F7FC8@hotmail.com>
Snowman wrote:
> 
> In POV-Ray, you are allowed to input 3 coordinates when using the triangle
> function. Thus, the triangle can be rotated and placed in any three
> dimensional plane without using the rotate function.
> Can you do the same to a polygon so that it lies in any plane you
> choose. I have tried doing this without success so far. I understand
> that all the points would need to fall on that plane.

They need to fall *exactly* in the plane.  My experience is that the
slightest round-off error can throw points out of the plane, and this
will cause POV-Ray to reject the polygon.

A better approach is to declare the vertices in the 2d coordinate
plane of your choice (x-y, x-z, or y-z), and then use a transform to
place it.

Triangles will work better, though.

Regards,
John


Post a reply to this message

From: Jérôme Grimbert
Subject: Re: Polygons in a 3D plane?
Date: 12 Mar 2001 06:34:36
Message: <3AACB4C2.DAE069F1@atosorigin.com>
Snowman wrote:
> 
> Maybe I should have explained better:
> I am trying to create shapes in a 3D plane without using triangles, i.e. its
> a lot easier to program 1 pentagon than 5 triangles.

You only need 3 triangles to make a pentagon, not 5!


Post a reply to this message

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