POV-Ray : Newsgroups : povray.general : Mirroring a pigment? Server Time
7 Aug 2024 19:27:28 EDT (-0400)
  Mirroring a pigment? (Message 1 to 9 of 9)  
From: Bob Franke
Subject: Mirroring a pigment?
Date: 24 May 2001 02:39:43
Message: <3B0CAC6C.4B589080@hotmail.com>

same pigment, such as  Blue_Sky,  on one hemisphere and use the mirror
of that texture on the other hemisphere.  I have tried rotating the

Thanks in advance for any help,
Bob


Post a reply to this message

From: Peter Popov
Subject: Re: Mirroring a pigment?
Date: 24 May 2001 02:46:51
Message: <4kbpgtgag9btb3tspju0ne6ske77gpriaf@4ax.com>
On Wed, 23 May 2001 23:38:36 -0700, Bob Franke
<bob### [at] hotmailcom> wrote:


>same pigment, such as  Blue_Sky,  on one hemisphere and use the mirror
>of that texture on the other hemisphere.  I have tried rotating the

>Thanks in advance for any help,

Scale it -1 along the axis you want to mirror it about.

Mirror x: scale <-1,1,1>
Mirror y: scale <1,-1,1>
Mirror z: scale <1,1,-1>


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: John VanSickle
Subject: Re: Mirroring a pigment?
Date: 24 May 2001 13:03:02
Message: <3B0D3FF1.A0441D65@erols.com>
Peter Popov wrote:
> 
> On Wed, 23 May 2001 23:38:36 -0700, Bob Franke
> <bob### [at] hotmailcom> wrote:
> 

> >the same pigment, such as  Blue_Sky,  on one hemisphere and use the
> >mirror of that texture on the other hemisphere.  I have tried

> >Thanks in advance for any help,
> 
> Scale it -1 along the axis you want to mirror it about.
> 
> Mirror x: scale <-1,1,1>
> Mirror y: scale <1,-1,1>
> Mirror z: scale <1,1,-1>

And if that axis is not parallel to any of the coordinate axes:

#local vA=vnormalize(Axis_of_Mirroring);
matrix <1-2*vA.x*vA.x, -2*vA.x*vA.y, -2*vA.x*vA.z,
matrix <-2*vA.x*vA.y, 1-2*vA.y*vA.y, -2*vA.y*vA.z,
matrix <-2*vA.x*vA.z, -2*vA.y*vA.z, 1-2*vA.z*vA.z,
        0, 0, 0 >

This is untested, but I'm confident it works.

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

From: Christoph Hormann
Subject: Re: Mirroring a pigment?
Date: 24 May 2001 13:49:42
Message: <3B0D49E7.A58E6795@gmx.de>
John VanSickle wrote:
> 
> And if that axis is not parallel to any of the coordinate axes:
> 
> #local vA=vnormalize(Axis_of_Mirroring);
> matrix <1-2*vA.x*vA.x, -2*vA.x*vA.y, -2*vA.x*vA.z,
> matrix <-2*vA.x*vA.y, 1-2*vA.y*vA.y, -2*vA.y*vA.z,
> matrix <-2*vA.x*vA.z, -2*vA.y*vA.z, 1-2*vA.z*vA.z,
>         0, 0, 0 >
> 
> This is untested, but I'm confident it works.
> 

Surely not the way it is, better use (untested too BTW):

#local vA=vnormalize(Axis_of_Mirroring);
matrix <1-2*vA.x*vA.x,  -2*vA.x*vA.y,  -2*vA.x*vA.z,
         -2*vA.x*vA.y, 1-2*vA.y*vA.y,  -2*vA.y*vA.z,
         -2*vA.x*vA.z,  -2*vA.y*vA.z, 1-2*vA.z*vA.z,
                    0,             0,             0 >

Anyway i would not be able to write this down straigt away like you, would
rather use the 'rotate, scale, rotate back' method.  

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: John VanSickle
Subject: Re: Mirroring a pigment?
Date: 24 May 2001 13:56:57
Message: <3B0D4C95.E4867033@erols.com>
Christoph Hormann wrote:
> 
> John VanSickle wrote:
> >
> > And if that axis is not parallel to any of the coordinate axes:
> >
> > #local vA=vnormalize(Axis_of_Mirroring);
> > matrix <1-2*vA.x*vA.x, -2*vA.x*vA.y, -2*vA.x*vA.z,
> > matrix <-2*vA.x*vA.y, 1-2*vA.y*vA.y, -2*vA.y*vA.z,
> > matrix <-2*vA.x*vA.z, -2*vA.y*vA.z, 1-2*vA.z*vA.z,
> >         0, 0, 0 >
> >
> > This is untested, but I'm confident it works.
> >
> 
> Surely not the way it is, better use (untested too BTW):
> 
> #local vA=vnormalize(Axis_of_Mirroring);
> matrix <1-2*vA.x*vA.x,  -2*vA.x*vA.y,  -2*vA.x*vA.z,
>          -2*vA.x*vA.y, 1-2*vA.y*vA.y,  -2*vA.y*vA.z,
>          -2*vA.x*vA.z,  -2*vA.y*vA.z, 1-2*vA.z*vA.z,
>                     0,             0,             0 >

Note to self:  Edit better when using cut-and-paste...

> Anyway i would not be able to write this down straight away like you,

Only took me about five minutes to work out the matrix.

> would rather use the 'rotate, scale, rotate back' method.

Yeah, that would work, too.

-- 
ICQ: 46085459


Post a reply to this message

From: ingo
Subject: Re: Mirroring a pigment?
Date: 24 May 2001 18:31:55
Message: <Xns90AC56942998seed7@povray.org>
> And if that axis is not parallel to any of the coordinate axes:
> #local vA=vnormalize(Axis_of_Mirroring);
> matrix [...]
 
 You know, there are some of these days on the net, I enjoy more than 
average, they make me smile in a certain way. It happens sometimes on 
the USENET but also on this, relative small, server. For example, a 
thread with a peculiar problem is going on a few days;
    1. A day, or two, after you think, everything is said and 
explained, Chis Colefax suddenly comes 'crawling from under his stone'. 
He gives a simple yet elegant solution to the problem, in a way that 
makes all of us hurry, to catch our lower jaw before it hits the 
ground.
Or ...
    2. the problem discussed is about some esoteric transformation. 
After a possible solution or two published, John VanSickle appears with 
4-5 lines of nifty code, containing the word 'matrix'. And then the 
'MatrixMan' has the guts to say:
> This is untested, but I'm confident it works.
... and it does, not just for this case but for all related.

I love it,
thank you,

Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Bob Franke
Subject: Re: Mirroring a pigment?
Date: 24 May 2001 22:10:50
Message: <3B0DBEE8.B9666CA9@hotmail.com>
This is what I love about the Internet, got a problem, put my question out
there and check the next day for a bunch of great answers.  The negative
scale method works for me.  If I have more time I will check out the
matrix.  Now I can get back to modeling my ladybug.

Thanks guys,
Bob


Post a reply to this message

From: Ken
Subject: Re: Mirroring a pigment?
Date: 24 May 2001 22:19:19
Message: <3B0DC1E7.6F5F8704@pacbell.net>
Bob Franke wrote:
> 
> This is what I love about the Internet, got a problem, put my question out
> there and check the next day for a bunch of great answers.

Well, that is at least true for this part of the internet.

-- 
Ken Tyler


Post a reply to this message

From: John VanSickle
Subject: Re: Mirroring a pigment?
Date: 26 May 2001 13:50:45
Message: <3B0FEE31.4738E7E2@erols.com>
ingo wrote:
> 
>  You know, there are some of these days on the net, I enjoy more than
> average, they make me smile in a certain way. It happens sometimes on
> the USENET but also on this, relative small, server. For example, a
> thread with a peculiar problem is going on a few days;
>     1. A day, or two, after you think, everything is said and
> explained, Chis Colefax suddenly comes 'crawling from under his
> stone'. He gives a simple yet elegant solution to the problem, in a
> way that makes all of us hurry, to catch our lower jaw before it hits
> the ground.
> Or ...
>     2. the problem discussed is about some esoteric transformation.
> After a possible solution or two published, John VanSickle appears
> with 4-5 lines of nifty code, containing the word 'matrix'. And then
> the 'MatrixMan' has the guts to say:
> > This is untested, but I'm confident it works.
> ... and it does, not just for this case but for all related.

One of my Throughly Useful Macros can also do mirroring:

Stretch(Vector,-1)

Silly, not to think of it.

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

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