POV-Ray : Newsgroups : povray.advanced-users : Bizzare space mapping problem : Re: Bizzare space mapping problem Server Time
27 Sep 2024 01:16:53 EDT (-0400)
  Re: Bizzare space mapping problem  
From: scott
Date: 11 Sep 2007 06:40:59
Message: <46e670bb@news.povray.org>
> I'm attempting to solve a problem so fiddly that it's really quite hard to 
> explain what I'm even trying to *do*!
>
> Basically, I want to make a 2D pattern with seemless repeats out of a 
> normal POV-Ray 3D pattern. However, I can't seem to find a way to take a 
> flat 2D grid and bend it into some kind of 3D form in such a way that the 
> pattern has a uniform frequency everywhere.

A good trick I know from realtime 3D graphics is as follows:

Define 3 patterns for the X Y and Z planes.  At each point on the surface 
you are rendering, take a weighted average of the 3 patterns based on the 
magnitude of the normal vector in that direction.  So if your surface normal 
is <1,0,0> or <-1,0,0> you would take 100% from pattern X, and none from the 
others.  etc

This way you get a nice smooth blending that covers the entire shape nicely 
and you don't get any areas where the pattern looks horribly stretched.

It works very well for organic shaped things (eg rocks, animals) with 
organic-type textures (wood/grass/granite).

Not sure how you would implement this in POV, but given the flexibility of 
POV I'm sure someone could implement it (I think you need megaPOV to use the 
normal data in a pattern).


Post a reply to this message

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