POV-Ray : Newsgroups : povray.newusers : Polyhedra -- intersections of planes or unions of faces? : Re: Polyhedra -- intersections of planes or unions of faces? Server Time
5 Jul 2024 10:15:25 EDT (-0400)
  Re: Polyhedra -- intersections of planes or unions of faces?  
From: Alain
Date: 16 May 2010 17:01:15
Message: <4bf05d1b@news.povray.org>

> Thanks to the two of you for the helpful advice.  I have a follow-up question on
> the use of these image maps:  I have a total of 6 images that I'm going to use
> for these image maps, which are photographs of this  object (the real object
> that I'm attempting to render) from the front, back, top, bottom, and sides.
> What I would like to do is:  for each face of each polyhedron, color that face
> with the image map whose orientation is most compatible with that face.  For
> instance, if my object is facing in the -z direction, if I have a face that is
> most closely aligned with the xy plane, then I'd want to use either the front
> picture or the back picture for the image map.  My question is:  is it efficient
> enough to specify these image maps one-by-one for each triangle in the mesh, or
> should I have a total of 6 meshes, each consisting of the set of all triangles
> sharing a particular orientation (i.e. "all the triangles that are colored with
> the front image, all the triangles that are colored with the top image", etc.)
>
> Thanks!  GB
>
> clipka<ano### [at] anonymousorg>  wrote:
>> Am 16.05.2010 09:17, schrieb Garrett Baird:
>>
>>> I've spent a bit of time googling but I've not been able to answer a rather
>>> basic question:  I've got a scene that consists of around 300 polyhedra, each of
>>> which is described by about 20 linear inequalities of the form ax + by + cz<=
>>> d.  The faces of these polyhedra have different image maps that are being
>>> applied to them.  Is it faster if I represent these polyhedra as a union of
>>> faces, rather than an intersection of half planes?  Currently my scene is
>>> rendering very slowly and I'd like to know if it's bad coding on my part or just
>>> the way things work.
>>
>> Specifying a bounding box (using bounded_by) might help a lot, as
>> POV-Ray will probably be unable to auto-generate bounding boxes for the
>> polyhedra.
>>
>> But, as Warp already noted, using a mesh would be the most efficient.
>> (You might want to use a mesh instead of a mesh2 though; not that it
>> makes any difference in speed - both use the same internal
>> representation - but usually a mesh is easier to generate from SDL.)
>
>
>
>

You can have one mesh per face, each with it's own image_map. You then 
combine the various faces toggether using an union.

You can also combine the various views into a single image and, using UV 
maping, have that image wrap around a single mesh.

You can also have a single mesh and apply different images to different 
areas.



Alain


Post a reply to this message

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