POV-Ray : Newsgroups : povray.advanced-users : Bizzare space mapping problem Server Time
26 Sep 2024 23:54:48 EDT (-0400)
  Bizzare space mapping problem (Message 11 to 13 of 13)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: andrel
Subject: Re: Bizzare space mapping problem
Date: 8 Sep 2007 06:22:09
Message: <46E278CF.6000507@hotmail.com>
Orchid XP v3 wrote:
> Warp wrote:
>>   Can you describe, even at a conceptual level, how you could map a 2D
>> pattern onto a 3D shape with no stretching whatsoever?
> 
> I've spent about 20 minutes attempting to bend my mind around such a 
> concept... Apparently my mind is insufficiently bendy.
> 
> I know it's impossible to map *a sphere* onto a flat grid without 
> distortion, but I'm uncertain as to whether there exists *any* 3D 
> surface can be mapped to a 2D one without disturtion.
> 
- simple one: a cylinder.
- any infinite continuous surface that extends linear in one direction 
(of which the cylinder and the plane are special cases)
- a finite object where for every point there is a straight line that 
extends over the whole object (a cone is such an object, another is the 
side of http://ec1.images-amazon.com/images/I/2181V1N9QCL._AA170_.jpg )


Post a reply to this message

From: scott
Subject: Re: Bizzare space mapping problem
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

From: Alain
Subject: Re: Bizzare space mapping problem
Date: 11 Sep 2007 07:43:44
Message: <46e67f70@news.povray.org>
scott nous apporta ses lumieres en ce 2007/09/11 06:40:
>> 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).
> 
> 
There is the slope pattern that can take any arbitrary refference vector. That 
combined with the average pattern could be used to do something similar.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you are compulsive, neurotic, 
anti-social, paranoid and manic-depressive but basically happy.
Quietly Watching


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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