POV-Ray : Newsgroups : povray.newusers : can't i rotate a pigment? Server Time
28 Apr 2024 20:45:40 EDT (-0400)
  can't i rotate a pigment? (Message 5 to 14 of 14)  
<<< Previous 4 Messages Goto Initial 10 Messages
From: Stephen
Subject: Re: can't i rotate a pigment?
Date: 7 May 2015 16:11:32
Message: <554bc6f4$1@news.povray.org>
On 07/05/2015 19:04, Anton Sherwood wrote:
> On 2015-5-07 10:16, Anton Sherwood wrote:
>> I'll try this:
>>
>>     object {
>>         ...
>>         rotate -N*y
>>         pigment { Tufte }
>>         rotate N*y
>>         }
>
> No luck.
>
Try changing the direction vector

pigment {
   slope {
     < 0.500, 0.000, 0.500 >  // <- Direction
   }
   color_map {
     [0.000 rgbft <1.000,0.000,0.000,0.000,0.000>]
     [0.534 rgbft <0.000,1.000,0.000,0.000,0.000>]
     [1.000 rgbft <0.000,0.000,1.000,0.000,0.000>]
   }

}


-- 

Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: can't i rotate a pigment?
Date: 8 May 2015 02:58:43
Message: <554c5ea3$1@news.povray.org>
On 7-5-2015 20:04, Anton Sherwood wrote:
> On 2015-5-07 10:16, Anton Sherwood wrote:
>> I'll try this:
>>
>>     object {
>>         ...
>>         rotate -N*y
>>         pigment { Tufte }
>>         rotate N*y
>>         }
>
> No luck.
>
No surprise: You rotate /the object/ a certain value around the y-axis, 
apply the pigment, rotate the object back the same value. You have not 
rotated /the pigment/ itself.

However, if the pigment is a slope pattern (along y-axis I suppose) I do 
not expect much to happen if you rotate it around the y-axis in any case.

-- 
Thomas


Post a reply to this message

From: Anton Sherwood
Subject: Re: can't i rotate a pigment?
Date: 8 May 2015 03:18:00
Message: <554c6328@news.povray.org>
On 2015-5-07 23:58, Thomas de Groot wrote:
> No surprise: You rotate /the object/ a certain value around the y-axis,
> apply the pigment, rotate the object back the same value. You have not
> rotated /the pigment/ itself.

Why not?  Generally

	object { ...
		texture { foo }
		translate ...
		}

is not the same as

	object { ...
		translate ...
		texture { foo }
		}

> However, if the pigment is a slope pattern (along y-axis I suppose)
> I do not expect much to happen if you rotate it around the y-axis
> in any case.

Not even if it's built of slopes along, say, some other vector(s)?

-- 
*\\* Anton Sherwood *\\* www.bendwavy.org


Post a reply to this message


Attachments:
Download 'tufte.inc.txt' (1 KB)

From: Anton Sherwood
Subject: Re: can't i rotate a pigment?
Date: 8 May 2015 03:19:14
Message: <554c6372$1@news.povray.org>
As there's only one object in the scene, I sidestepped the problem by 
rotating the object *and* the camera while letting the pigment stay put.

-- 
*\\* Anton Sherwood *\\* www.bendwavy.org


Post a reply to this message

From: Thomas de Groot
Subject: Re: can't i rotate a pigment?
Date: 8 May 2015 03:27:21
Message: <554c6559$1@news.povray.org>
On 8-5-2015 9:17, Anton Sherwood wrote:
> On 2015-5-07 23:58, Thomas de Groot wrote:
>> No surprise: You rotate /the object/ a certain value around the y-axis,
>> apply the pigment, rotate the object back the same value. You have not
>> rotated /the pigment/ itself.
>
> Why not?  Generally
>
>      object { ...
>          texture { foo }
>          translate ...
>          }
>
> is not the same as
>
>      object { ...
>          translate ...
>          texture { foo }
>          }
>

Hmm yes. I stand corrected for that one :-)

>> However, if the pigment is a slope pattern (along y-axis I suppose)
>> I do not expect much to happen if you rotate it around the y-axis
>> in any case.
>
> Not even if it's built of slopes along, say, some other vector(s)?
>

You are tickling the limits of my knowledge ;-)  Slope is a difficult 
pattern to use in my experience and I always need a lot of 
experimentation to get it right.

I shall need to make a test scene to see what happens. Back soon.

-- 
Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: can't i rotate a pigment?
Date: 8 May 2015 03:54:46
Message: <554c6bc6$1@news.povray.org>
On 8-5-2015 9:19, Anton Sherwood wrote:
> As there's only one object in the scene, I sidestepped the problem by
> rotating the object *and* the camera while letting the pigment stay put.
>

After testing, I can confirm that it is not possible to rotate a slope 
pattern, in contrast to other patterns. Even more puzzling, I can 
confirm that this is true too when applying the pigment and then 
rotating the object: the pigment remains unchanged and does not rotate 
with the object.

I do not know if this is a bug or is intentional. If the latest case, 
the documentation does not mention it while at the same time indicating 
the use of Pigment Modifiers in the example.

I believe we need the voice of an expert now.

-- 
Thomas


Post a reply to this message

From: Stephen
Subject: Re: can't i rotate a pigment?
Date: 8 May 2015 04:41:05
Message: <554c76a1$1@news.povray.org>
On 08/05/2015 08:54, Thomas de Groot wrote:

> After testing, I can confirm that it is not possible to rotate a slope
> pattern, in contrast to other patterns. Even more puzzling, I can
> confirm that this is true too when applying the pigment and then
> rotating the object: the pigment remains unchanged and does not rotate
> with the object.
>
> I do not know if this is a bug or is intentional. If the latest case,
> the documentation does not mention it while at the same time indicating
> the use of Pigment Modifiers in the example.
>
> I believe we need the voice of an expert now.
>

And I thought that you were the expert. ;-)

My understanding of the slope pattern is that the colour (value) is 
dependant on the normal of the point on the object being tested and the 
direction vector. So the pigment is tied to the object's shape. To 
rotate the patern, rotate the direction vector.

> The slope value at a given point is dependent on the angle between the <Direction>
vector and the normal of the surface at that point. For example:
> - When the surface normal points in the opposite direction of the <Direction> vector
(180 degrees), the slope is 0.0.
> - When the surface normal is perpendicular to the <Direction> vector (90 degrees),
the slope is 0.5.
> - When the surface normal is parallel to the <Direction> vector (0 degrees), the
slope is 1.0.



-- 

Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: can't i rotate a pigment?
Date: 8 May 2015 07:21:55
Message: <554c9c53@news.povray.org>
On 8-5-2015 10:41, Stephen wrote:
> On 08/05/2015 08:54, Thomas de Groot wrote:
>
>> After testing, I can confirm that it is not possible to rotate a slope
>> pattern, in contrast to other patterns. Even more puzzling, I can
>> confirm that this is true too when applying the pigment and then
>> rotating the object: the pigment remains unchanged and does not rotate
>> with the object.
>>
>> I do not know if this is a bug or is intentional. If the latest case,
>> the documentation does not mention it while at the same time indicating
>> the use of Pigment Modifiers in the example.
>>
>> I believe we need the voice of an expert now.
>>
>
> And I thought that you were the expert. ;-)

I am sorry to disappoint you ;-)

>
> My understanding of the slope pattern is that the colour (value) is
> dependant on the normal of the point on the object being tested and the
> direction vector. So the pigment is tied to the object's shape. To
> rotate the patern, rotate the direction vector.
>
>> The slope value at a given point is dependent on the angle between the
>> <Direction> vector and the normal of the surface at that point. For
>> example:
>> - When the surface normal points in the opposite direction of the
>> <Direction> vector (180 degrees), the slope is 0.0.
>> - When the surface normal is perpendicular to the <Direction> vector
>> (90 degrees), the slope is 0.5.
>> - When the surface normal is parallel to the <Direction> vector (0
>> degrees), the slope is 1.0.
>

Yes that is my understanding too, up to a point. What mystifies me is 
when an object is patterned with slope and then rotated: why is the 
pattern not following the rotation of the object? That is not correct to 
my understanding.

-- 
Thomas


Post a reply to this message

From: Stephen
Subject: Re: can't i rotate a pigment?
Date: 8 May 2015 10:15:03
Message: <554cc4e7$1@news.povray.org>
On 08/05/2015 12:21, Thomas de Groot wrote:
> I am sorry to disappoint you ;-)
>

You don't.

>>

>
> Yes that is my understanding too, up to a point. What mystifies me is
> when an object is patterned with slope and then rotated: why is the
> pattern not following the rotation of the object? That is not correct to
> my understanding.

It might have helped if I actually rotated the object.
Puzzling.
Try this instead.

     object {
         ...


         rotate N*y
         pigment { Tufte }

         }

It is hard to see on the SuperEllipsoid I was using.

-- 

Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: can't i rotate a pigment?
Date: 9 May 2015 03:29:32
Message: <554db75c$1@news.povray.org>
In summary, after a night pondering the issue, the slope pattern is 
applied at world-axis level, regardless of any transformation at 
local-axis level of the object. This makes slope different from the 
other patterns. This is consistent with the Docs.

To reduce confusion like we have experienced now, I think that the Docs 
should be adapted accordingly with an additional entry under *Note*, 
explaining why basic transformations of the pattern or the object do not 
work as expected.

As a solution to the initial question, I see two possibilities:

- Baking the texture using the mesh camera. See for an excellent 
explanation: http://www.ignorancia.org/en/index.php?page=mesh-camera

Using a proximity pattern technique as was developed e.g. by Sam Benge 
or Edouard Poor. This is not exactly the same as a slope pattern but can 
come close. Personally, I prefer, and use, Edouard Poor's method. I do 
not have the exact location at hand but look for the code in 
povray.binaries.scene-files, under author Edouard, date 10-9-2009.

-- 
Thomas


Post a reply to this message

<<< Previous 4 Messages Goto Initial 10 Messages

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