POV-Ray : Newsgroups : povray.general : mesh for icosahedron Server Time
8 Aug 2024 16:18:18 EDT (-0400)
  mesh for icosahedron (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
From: Chris Huff
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 16:07:37
Message: <chrishuff-EC044D.16090030122000@news.povray.org>
In article <3a4e2a28@news.povray.org>, "Greg M. Johnson" 
<"gregj;-)56590\""@aol.c;-)om> wrote:

> 1) Does anyone have code for making a mesh which is an icosahedron?

You might find something here:
http://www.swin.edu.au/astronomy/pbourke/


> 2) Does anyone have code for making a N-triangle approximation of a
> sphere (please don't code this just for me--does it already exist)?

Maybe you can find something useful in one of the discussions about 
"evenly spaced points on a sphere" on these groups...


> 3) Say I'm going to put a few thousand spheres in a union, but then want
> to replace the spheres with meshes for memory's sake.  How many
> triangles (I assume it's several thousand) does it take to cause the
> same memory usage/parse time  as one sphere?

A single-triangle mesh will probably use more memory than a single 
sphere, assuming texturing is the same. A copy of a mesh (of any size) 
will probably use slightly less memory than a sphere, again with all 
else equal.
For parse time, you will have to test it...but it would most likely be 
less for a copy of a mesh than a sphere.

-- 
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: Greg M  Johnson
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 17:38:14
Message: <3a4e63d6@news.povray.org>
Chris Huff wrote:

> > 2) Does anyone have code for making a N-triangle approximation of a
> > sphere (please don't code this just for me--does it already exist)?
>
> Maybe you can find something useful in one of the discussions about
> "evenly spaced points on a sphere" on these groups...

I've actually coded the scenario you described fairly successfully.  The
problem comes in trying to figure out which of the points should be the
vertices of the triangles.


Post a reply to this message

From: Jan Walzer
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 18:23:22
Message: <3a4e6e6a$1@news.povray.org>
I did one some weeks ago (of course in POV) ...
(just a try for myself) ...

I'll post it in p.b.s-f (If I find it again ...)

--
Jan Walzer


Post a reply to this message

From: Jan Walzer
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 18:23:24
Message: <3a4e6e6c$1@news.povray.org>
> > > 2) Does anyone have code for making a N-triangle approximation of a
> > > sphere (please don't code this just for me--does it already exist)?
> >
> > Maybe you can find something useful in one of the discussions about
> > "evenly spaced points on a sphere" on these groups...
>
> I've actually coded the scenario you described fairly successfully.  The
> problem comes in trying to figure out which of the points should be the
> vertices of the triangles.

I made some thoughts about this myself ...

It should be go with a recursive algorithm .... (sounds like StarTrek,
heheeee ...)

Imagine a regular tetraedron (ABCD),
with it's center (M),
having |A-M|=|B-M|=|C-M|=|D-M|=r


1) do for every triangle (ABC,ACD,ABD,BCD):
2)  divide it into 4 regular triangles
3)  normalize the distance of the 3 new points and the center (M) to r
4) go back to 1 until the sphere is fine enough ...

all clear ???

--
Jan Walzer
(currently no Signature)


Post a reply to this message

From: Chris Huff
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 18:39:13
Message: <chrishuff-91119A.18403730122000@news.povray.org>
In article <3a4e6e6c$1@news.povray.org>, "Jan Walzer" <jan### [at] lzernet> 
wrote:

> It should be go with a recursive algorithm .... (sounds like StarTrek,
> heheeee ...)

...snip...

That won't let you specify a specific number of triangles to use, only a 
recursion level. The number of triangles increases rather rapidly with 
recursion level.

-- 
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: David Fontaine
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 23:31:13
Message: <3A4EB4AA.E0F9E334@faricy.net>
"Greg M. Johnson" wrote:

> 1) Does anyone have code for making a mesh which is an icosahedron?

That reminds me, I was gonna unzip most of the source at my website...
 http://davidf.faricy.net/source/meshpoly.inc


> 2) Does anyone have code for making a N-triangle approximation of a
> sphere (please don't code this just for me--does it already exist)?

I did this once, start with a regular polyhedron (tetra, octa or icosa will
work), subdivide each face into four triangles and normalize the vertices.
Recursive macro of course.

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: David Fontaine
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 23:32:51
Message: <3A4EB50D.EE393FD4@faricy.net>
David Fontaine wrote:

> > 2) Does anyone have code for making a N-triangle approximation of a
> > sphere (please don't code this just for me--does it already exist)?
>
> I did this once, start with a regular polyhedron (tetra, octa or icosa will
> work), subdivide each face into four triangles and normalize the vertices.
> Recursive macro of course.

BTW I just thought of something, to use fewer triangles you could make the last
iteration subdivide into 2 or 3 instead.

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: Pete
Subject: Re: mesh for icosahedron
Date: 1 Jan 2001 13:32:21
Message: <394.401T1635T6914868PeterC@nym.alias.net>
Greg M. Johnson wrote:

> 2) Does anyone have code for making a N-triangle approximation of a
> sphere (please don't code this just for me--does it already exist)?

        Uwe Zimmermann wrote a utility called "geodesic.inc" which
does this.  I forget the URL but I know there is a pointer to it
from somewhere on the main povray site (the macros & include files
section).  It's rather handy.


Post a reply to this message

From: John VanSickle
Subject: Re: mesh for icosahedron
Date: 3 Jan 2001 03:28:00
Message: <3A52F757.4265EEF6@erols.com>
"Greg M. Johnson" wrote:
> 
> 1) Does anyone have code for making a mesh which is an icosahedron?

If you download my Surface Subdivision Suite at

  http://users4.50megs.com/enphilistor/sss.htm

you should find therein code that will make you an icosahedron; it
can also subdivide it to make a smoother sphere.

Regards,
John


Post a reply to this message

From: Ron Parker
Subject: Re: mesh for icosahedron
Date: 3 Jan 2001 15:12:09
Message: <slrn9571sr.bc6.ron.parker@fwi.com>
On Sat, 30 Dec 2000 18:40:37 -0500, Chris Huff wrote:
>In article <3a4e6e6c$1@news.povray.org>, "Jan Walzer" <jan### [at] lzernet> 
>wrote:
>
>> It should be go with a recursive algorithm .... (sounds like StarTrek,
>> heheeee ...)
>
>...snip...
>
>That won't let you specify a specific number of triangles to use, only a 
>recursion level. The number of triangles increases rather rapidly with 
>recursion level.

One way to provide more options is to also allow starting with a regular
octahedron or icosahedron.

My golfball code (at the address below) contains the germ of this algorithm
for a starting point of an icosahedron.  It only generates the vertices, 
not the triangles, but it might be a good starting point.   I've been meaning
to generalize it a little (replace the constant #defines with a smaller number
of constant #defines) but I haven't gotten around to it yet.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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