POV-Ray : Newsgroups : povray.general : MMacros texture Server Time
17 Nov 2024 09:17:24 EST (-0500)
  MMacros texture (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: leseur sylvain
Subject: MMacros texture
Date: 24 Apr 2003 12:48:32
Message: <3ea81560@news.povray.org>
//How can i use this kind of macros texture ???
//Thanks a lot
//Friendly
//.Sylvain
//
//
//



// usage:
//(PatternNumber : 0 - 30)
//pigment { P_Checker(PatternNumber, pigment1, pigment2)  }
//texture { T_Checker(PatternNumber, texture1, texture2)  }
//
//(PatternNumber : 0 - 99)
//pigment { P_Checker2(PatternNumber, pigment1, pigment2)  }
//texture { T_Checker2(PatternNumber, texture1, texture2)  }
//
//(PatternNumber : 0 - 10)
//pigment { P_Hexagon(PatternNumber,pigment1,pigment2, pigment3)}
//texture { T_Hexagon(PatternNumber,texture1,texture2, texture3)}
//
//(PatternNumber : 0 - 3)
//pigment { P_Hexagon2(PatternNumber,pigment1,pigment2,pigment3,pigment4) }
//texture { T_Hexagon2(PatternNumber,texture1,texture2,texture3,texture4) }
//
// ----------------------------------------------------------------------
//

#macro P_CheckerSub(Pigment1, Pigment2)
    checker
    pigment {Pigment1}
    pigment {Pigment2}
#end

#macro P_Checker(PatternNo, Pigment1, Pigment2)
    #switch (PatternNo)
    #case (1)
        P_CheckerSub(Pigment1, Pigment2)
        rotate y*45
        rotate -x*degrees(acos(1/sqrt(3)))
    #break
    #case (2)
        P_CheckerSub(Pigment1, Pigment2)
        rotate y*45
        rotate -x*degrees(acos(1/sqrt(3)))
        scale <1,1/sqrt(3),1/sqrt(3)>
        rotate y*-45
    #break
    #case (3)
        checker
        pigment {P_CheckerSub(Pigment1, Pigment2) scale 1/4}
        pigment {P_CheckerSub(Pigment1, Pigment2) scale 1/2}

    #else
        P_CheckerSub(Pigment1, Pigment2)
    #end
    scale <1,1e6,1>
#end




//////////////////////////////////////////////////////////
#macro T_CheckerSub(Texture1, Texture2)
    checker
    texture {Texture1}
    texture {Texture2}
#end

#macro T_Checker(PatternNo, Texture1, Texture2)
    #switch (PatternNo)
    #case (1)
        T_CheckerSub(Texture1, Texture2)
        rotate y*45
        rotate -x*degrees(acos(1/sqrt(3)))
    #break
    #case (2)
        T_CheckerSub(Texture1, Texture2)
        rotate y*45
        rotate -x*degrees(acos(1/sqrt(3)))
        scale <1,1/sqrt(3),1/sqrt(3)>
        rotate y*-45
    #break
    #case (3)
        checker
        texture {T_CheckerSub(Texture1, Texture2) scale 1/4}
        texture {T_CheckerSub(Texture1, Texture2) scale 1/2}
    #break


    #else
        T_CheckerSub(Texture1, Texture2)
    #end
    scale <1,1e6,1>
#end




////////////////////////////////////////////////////////////
#macro P_Checker2Sub(Pigment1, Pigment2, Sc1, Sc2)
    wood
    pigment_map {
      [.5/Sc1  Pigment1]
      [.5/Sc1  Pigment2]
    }
    ramp_wave
    scale Sc2
    rotate x*90
#end

#macro P_Checker2(PatternNo, Pigment1, Pigment2)
    #switch (PatternNo)
    #case (1)
        checker  pigment {
            P_Checker2Sub(Pigment1, Pigment2, 10, 20)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        pigment {
            P_Checker2Sub(Pigment2, Pigment1, 10, 20)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        scale 2
    #break
    #case (2)
        checker   pigment {
            P_Checker2Sub(Pigment1, Pigment2, 10, 10)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        pigment {
            P_Checker2Sub(Pigment2, Pigment1, 10, 10)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        scale 2
    #break
    #case (3)
        checker  pigment {
            P_Checker2Sub(Pigment1, Pigment2, 1, 1)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        pigment {
            P_Checker2Sub(Pigment2, Pigment1, 1, 1)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        scale 2
    #break


    #else
        P_Checker2Sub(Pigment1, Pigment2, 20, 20)
        translate <.5,0,.5>
        warp {repeat x}
        warp {repeat z}
        scale 2
    #end
    scale <1,1e6,1>
#end




////////////////////////////////////////////////////
#macro T_Checker2Sub(Texture1, Texture2, Sc1, Sc2)
    wood    texture_map {
      [.5/Sc1  Texture1]
      [.5/Sc1  Texture2]
    }
    ramp_wave
    scale Sc2
    rotate x*90
#end

#macro T_Checker2(PatternNo, Texture1, Texture2)
    #switch (PatternNo)
    #case (1)
        checker texture {
            T_Checker2Sub(Texture1, Texture2, 10, 20)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        texture {
            T_Checker2Sub(Texture2, Texture1, 10, 20)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        scale 2
    #break
    #case (2)
        checker  texture {
            T_Checker2Sub(Texture1, Texture2, 10, 10)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        texture {
            T_Checker2Sub(Texture2, Texture1, 10, 10)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        scale 2
    #break
    #case (3)
        checker  texture {
            T_Checker2Sub(Texture1, Texture2, 1, 1)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        texture {
            T_Checker2Sub(Texture2, Texture1, 1, 1)
            scale .5
            translate <.5,0,.5>
            warp {repeat x}
            warp {repeat z}
        }
        scale 2
    #break


    #else
        T_Checker2Sub(Texture1, Texture2, 20, 20)
        translate <.5,0,.5>
        warp {repeat x}
        warp {repeat z}
        scale 2
    #end
    scale <1,1e6,1>
#end




/////////////////////////////////////////////////////////////////////////
// Hexagon
#macro P_HexagonSub(P1, P2, P3)
    hexagon
    pigment{P1}
    pigment{P2}
    pigment{P3}
#end

#macro P_Hexagon(PatternNo, P1, P2, P3)
    #switch (PatternNo)
    #case (1)
  hexagon      //111111111111&&
  pigment{P_HexagonSub(P1, P2, P3) translate<1/2,0,sqrt(3)/2>}
  pigment{P_HexagonSub(P1, P2, P3) translate -x}
  pigment{P_HexagonSub(P1, P2, P3) translate<1/2,0,-sqrt(3)/2>}
    #break
    #case (2)

  pigment{P_HexagonSub(P1, P2, P3) translate<1/2,0,sqrt(3)/2>}
  pigment{P_HexagonSub(P3, P1, P2) translate -x}
  pigment{P_HexagonSub(P2, P3, P1) translate<1/2,0,-sqrt(3)/2>}
    #break
    #case (3)
  hexagon  //333333333333333
  pigment{P_HexagonSub(P1, P2, P3) translate<1/2,0,sqrt(3)/2>}
  pigment{P_HexagonSub(P1, P2, P3) translate -x rotate y*60}
  pigment{P_HexagonSub(P1, P2, P3) translate<1/2,0,-sqrt(3)/2>}
    #break

    #else
  P_HexagonSub(P1, P2, P3)
    #end
    scale <1,1e6,1>
#end




//////////////////////////////////////////////////////////////////////////
#macro P_Hexagon2(PatternNo, P1, P2, P3, P4)
    #switch (PatternNo)
    #case (1)
  hexagon
  pigment{P_HexagonSub(P1, P2, P3) translate<1/2,0,sqrt(3)/2>}
  pigment{P_HexagonSub(P2, P3, P1) translate -x}
  pigment{P_HexagonSub(P4, P4, P4) translate<1/2,0,-sqrt(3)/2>}
    #break
    #case (2)
  hexagon
  pigment{P_HexagonSub(P1, P2, P3) translate<1/2,0,sqrt(3)/2>}
  pigment{P_HexagonSub(P1, P2, P3) translate -x rotate y*60}
  pigment{P4}
    #break
    #case (3)
  hexagon
  pigment{P_HexagonSub(P1, P2, P3) rotate y*30 scale sqrt(3)/2 }
  pigment{P4}
  pigment{P4}
    #break
    #else
  hexagon
  pigment{P_HexagonSub(P1, P2, P3) translate<1/2,0,sqrt(3)/2>}
  pigment{P_HexagonSub(P1, P2, P3) translate -x}
  pigment{P4}
    #end
    scale <1,1e6,1>
#end



/////////////////////////////////////////////////////////////
#macro T_HexagonSub(T1, T2, T3)
    hexagon
    texture{T1}
    texture{T2}
    texture{T3}
#end

#macro T_Hexagon(PatternNo, T1, T2, T3)
    #switch (PatternNo)
    #case (1)
  hexagon
  texture{T_HexagonSub(T1, T2, T3) translate<1/2,0,sqrt(3)/2>}
  texture{T_HexagonSub(T1, T2, T3) translate -x}
  texture{T_HexagonSub(T1, T2, T3) translate<1/2,0,-sqrt(3)/2>}
    #break
    #case (2)
  hexagon
  texture{T_HexagonSub(T1, T2, T3) translate<1/2,0,sqrt(3)/2>}
  texture{T_HexagonSub(T3, T1, T2) translate -x}
  texture{T_HexagonSub(T2, T3, T1) translate<1/2,0,-sqrt(3)/2>}
    #break
    #case (3)
  hexagon
  texture{T_HexagonSub(T1, T2, T3) translate<1/2,0,sqrt(3)/2>}
  texture{T_HexagonSub(T1, T2, T3) translate -x rotate y*60}
  texture{T_HexagonSub(T1, T2, T3) translate<1/2,0,-sqrt(3)/2>}
    #break

    #else
     T_HexagonSub(T1, T2, T3)
    #end
    scale <1,1e6,1>
#end




///////////////////////////////////////////////////////////////////////////
#macro T_Hexagon2(PatternNo, T1, T2, T3, T4)
    #switch (PatternNo)
    #case (1)
  hexagon
  texture{T_HexagonSub(T1, T2, T3) translate<1/2,0,sqrt(3)/2>}
  texture{T_HexagonSub(T2, T3, T1) translate -x}
  texture{T_HexagonSub(T4, T4, T4) translate<1/2,0,-sqrt(3)/2>}
    #break
    #case (2)
  hexagon
  texture{T_HexagonSub(T1, T2, T3) translate<1/2,0,sqrt(3)/2>}
  texture{T_HexagonSub(T1, T2, T3) translate -x rotate y*60}
  texture{T4}
    #break
    #case (3)
  hexagon
  texture{T_HexagonSub(T1, T2, T3) rotate y*30 scale sqrt(3)/2 }
  texture{T4}
  texture{T4}
    #break
    #else
  hexagon
  texture{T_HexagonSub(T1, T2, T3) translate<1/2,0,sqrt(3)/2>}
  texture{T_HexagonSub(T1, T2, T3) translate -x}
  texture{T4}
    #end
    scale <1,1e6,1>
#end
  //fin de checker.inc






/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
//(Moray)
// Use right handed-system
// Where Z is up
camera {  //  Camera StdCam
  location  <    -12.000,     -20.000,      15.000>
  sky       <    0.00000,     0.00000,     1.00000>
  up        <        0.0,         0.0,         1.0>
  right     <    1.35836,         0.0,         0.0>
  angle         40.00000    // Vertical      30.000
  look_at   <      0.000,       0.000,       0.000>
}



light_source {   // Light1
  <0.0, 0.0, 0.0>
  color rgb <1.000, 1.000, 1.000>
  translate  <0.0, -20.0, 20.0>
}
 //?????????????????????????????????????????


Post a reply to this message

From: Christopher James Huff
Subject: Re: MMacros texture
Date: 24 Apr 2003 14:48:40
Message: <cjameshuff-459035.14483124042003@netplex.aussie.org>
In article <3ea81560@news.povray.org>,
 "leseur sylvain" <syl### [at] potar-hurlantcom> wrote:

> //How can i use this kind of macros texture ???

Well, the usage instructions were given right at the top of your 
message. What happens when you try something like that?

BTW, when you need to post the same message to multiple groups, it is 
preferred if you cross-post, instead of posting the same thing several 
times. That way, most newsreaders will notice if a message has already 
been read, and it takes up less room on the server. Also, throwing such 
a large block of code in your message is a bad idea outside of the scene 
file groups. Since you apparently didn't write these, it would have been 
better to just mention where you got them.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: leseur sylvain
Subject: Re: MMacros texture
Date: 25 Apr 2003 02:02:51
Message: <3ea8cf8b@news.povray.org>
>>BTW, when you need to post the same message to multiple groups, it is
>>preferred if you cross-post, instead of posting the same thing several
>>times.
    Ok. But, it is, at the same time for News_User, and Macro is not an
easy thing and i though Povray_General too.
 What does it means BTW ?


>>That way, most newsreaders will notice if a message has already
>>been read, and it takes up less room on the server.
>>Also, throwing such
>>a large block of code in your message is a bad idea outside of the scene
>>file groups.
    Ok.  Your way is a best idea. Sorry.


>>Since you apparently didn't write these, it would have been
>>better to just mention where you got them.
    Ok, it's true, of course. It's a part of:
// checker.inc version 1.00
// copyright Shiro Nakayama (syl### [at] cg-cgcom) 2002
// date  2002.11.04



>>Well, the usage instructions were given right at the top of your
>>message. What happens when you try something like that?
    I don't understand "usage"
// usage:
//(PatternNumber : 0 - 30)
//pigment { P_Checker(PatternNumber, pigment1, pigment2)  }
//texture { T_Checker(PatternNumber, texture1, texture2)  }etc...
I just wish to have one box and render each texture one by one.


Sorry again for stupid mistake.
Friendly
Sylvain.


Post a reply to this message

From: Christopher James Huff
Subject: Re: MMacros texture
Date: 25 Apr 2003 12:43:40
Message: <cjameshuff-D9309F.12441025042003@netplex.aussie.org>
In article <3ea8cf8b@news.povray.org>,
 "leseur sylvain" <syl### [at] potar-hurlantcom> wrote:

> >>BTW, when you need to post the same message to multiple groups, it is
> >>preferred if you cross-post, instead of posting the same thing several
> >>times.
>     Ok. But, it is, at the same time for News_User, and Macro is not an
> easy thing and i though Povray_General too.
>  What does it means BTW ?

What does what mean? Cross posting? It is a way to post one message to 
multiple groups. I'm not sure of the best way to do it with Outlook...


> >>Since you apparently didn't write these, it would have been
> >>better to just mention where you got them.
>     Ok, it's true, of course. It's a part of:
> // checker.inc version 1.00
> // copyright Shiro Nakayama (syl### [at] cg-cgcom) 2002
> // date  2002.11.04

Well, that doesn't tell where you got it, but I bet Shiro Nakayama knows 
more about how to use it than the people on these groups... ;-)


> >>Well, the usage instructions were given right at the top of your
> >>message. What happens when you try something like that?
>     I don't understand "usage"

The word "usage"? It means "how something is used".


> // usage:
> //(PatternNumber : 0 - 30)
> //pigment { P_Checker(PatternNumber, pigment1, pigment2)  }
> //texture { T_Checker(PatternNumber, texture1, texture2)  }etc...

The P_Checker() macro makes a pigment, T_Checker() makes an entire 
texture, PatternNumber is any number from 0 to 30.


> I just wish to have one box and render each texture one by one.

Something like this:

#include "colors.inc"
#include "checker.inc"

camera {
    orthographic
    location < 0, 0,-1>
    look_at < 0, 0, 0>
    right x*1 up y*1
}

#declare TexA = texture {pigment {color White}}
#declare TexA = texture {pigment {color Black}}

box {<-1,-1, 0>, < 1, 1, 1>
    texture {T_Checker(frame_number, TexA, TexB)}
}

And then render an animation with 30 frames.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: leseur sylvain
Subject: Re: MMacros texture
Date: 25 Apr 2003 13:54:14
Message: <3ea97646@news.povray.org>
Thanks a lot

>It's a part of:
> // checker.inc version 1.00
> // copyright Shiro Nakayama (syl### [at] cg-cgcom) 2002
> // date  2002.11.04
   >>Well, that doesn't tell where you got it, but I bet Shiro Nakayama
knows
   >>more about how to use it than the people on these groups... ;-)
I don't remember where i found  checker.inc and i'm
not shure  of  syl### [at] cg-cgcom  is good...
Thanks again
Friendly
Sylvain


Post a reply to this message

From: Christopher James Huff
Subject: Re: MMacros texture
Date: 25 Apr 2003 14:10:53
Message: <cjameshuff-CE4119.14112525042003@netplex.aussie.org>
In article <3ea97646@news.povray.org>,
 "leseur sylvain" <syl### [at] potar-hurlantcom> wrote:

> I don't remember where i found  checker.inc and i'm
> not shure  of  syl### [at] cg-cgcom  is good...

http://www.cg-cg.com/povray/macro.htm

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Alan Walkington
Subject: Re: MMacros texture
Date: 25 Apr 2003 14:31:10
Message: <3ea97eee$1@news.povray.org>
> >  What does it means BTW ?
>
By the way.

> What does what mean? Cross posting? It is a way to post one message to
> multiple groups. I'm not sure of the best way to do it with Outlook...
>

Multi-posting involves sticking separate posts about the same thing in
different newsgroups.   If someone spends time answering a question in this
newsgroup, and then finds that it has already been answered in another, it
sometimes annoys them. Cross-posting links these posts together so that when
someone replies in one newsgroup, the reply appears as if by magic in each
of the other newsgroups.

It's really quite simple, and is described in almost every NG FAQ ever
written.  In the line Newsgroups: (note that it is plural, which should give
you a hint!), you can type:
the names of each newsgroup seperated by comas:

povray.general, povray.windows, etc

And away you go.

Alan Walkington


Post a reply to this message

From:
Subject: Re: MMacros texture
Date: 25 Apr 2003 14:46:33
Message: <3ea98289$1@news.povray.org>
/*
    The second "#declare TexA ..." should be "#declare TexB ...".
    Only PatternNumbers from 1 to 3 and one default pattern are
    defined, so the following scene shows all these patterns.

       Sputnik

-------------------------------------

e-mail: fr### [at] computermuseumfh-kielde
-------------------------------------

*/



// -F +D +A0.1 +W800 +H600

#include "colors.inc"
#include "checker.inc"

camera { location <-10, 15, -15> look_at 0 }
light_source { <-150, 200, -100> color rgb 1 }

#declare TexA = texture { pigment { color White } }
#declare TexB = texture { pigment { color Red   } }
#declare TexC = texture { pigment { color Green } }
#declare TexD = texture { pigment { color Blue  } }

#declare N = 1;
#while (N<=4)
  #declare Z = N*8-12;
  box { <-10,-2,Z>, <-4,0,Z+6> texture { T_Checker (N,TexA,TexB)           } }
  box { < -2,-2,Z>, < 4,0,Z+6> texture { T_Checker2(N,TexA,TexB)           } }
  box { <  6,-2,Z>, <12,0,Z+6> texture { T_Hexagon (N,TexA,TexB,TexC)      } }
  box { < 14,-2,Z>, <20,0,Z+6> texture { T_Hexagon2(N,TexA,TexB,TexC,TexD) } }
  #declare N = N+1;
  #end//while Nr


Post a reply to this message

From: SYLVAIN LESEUR
Subject: Re: MMacros texture
Date: 25 Apr 2003 16:14:23
Message: <3ea9971f$1@news.povray.org>
>
> http://www.cg-cg.com/povray/macro.htm
>
> --
Of course like that, it's really more easy...
Thanks
Sylvain


Post a reply to this message

From: SYLVAIN LESEUR
Subject: Re: MMacros texture
Date: 25 Apr 2003 16:23:36
Message: <3ea99948@news.povray.org>
Now it's clear .
Ok
Thanks for the time
Friendly
Sylvain


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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