POV-Ray : Newsgroups : povray.advanced-users : I really really want n-sided bezier patches... : Re: I really really want n-sided bezier patches... Server Time
6 Jul 2024 18:24:17 EDT (-0400)
  Re: I really really want n-sided bezier patches...  
From: Rune
Date: 22 Aug 2002 19:21:28
Message: <3d6571f8$1@news.povray.org>
Rune wrote:
> Well, I can try to see if I can figure out your
> code enough to implement UV mapping, but don't
> count on it... ;)

Actually, uv-mapping should be easy to make, as the whole patch seems to
be based on uv coordinates in the first place. Well, the tricky part is
to write the triangles as a mesh2 rather than a regular mesh.

When writing the patch as a mesh2, the vertices have to come in a
logical order. The subdivision algorithm doesn't calculate the vertices
in a very intuitive order, but I've found out that the subdivision
approach isn't needed at all - the triangles can be made in a simple
double loop. This also means that the number of triangles per edge is
not limited to a power of two, but can be any number.

Writing the patch as a mesh2 will also cut down the number of
calculations to one sixth, as each vertex and normal is shared by six
triangles, which is taken advantage of in the mesh2 object.

I have not yet written the actual code, but I'll report back again when
it's done.

By the way - even though I can modify a few aspects of the code, I still
have no clue about the math behind it and the functions used, so I won't
be able to make the 5 and 6 sided patches myself. I'm still looking
forward to get my hands on those. :)

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com (updated July 12)
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

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