POV-Ray : Newsgroups : povray.general : Can I get the coordinate? Server Time
26 Nov 2024 13:18:38 EST (-0500)
  Can I get the coordinate? (Message 1 to 9 of 9)  
From: And
Subject: Can I get the coordinate?
Date: 10 Jul 2010 00:30:01
Message: <web.4c37f6d89e64bfadcf51b3890@news.povray.org>
I want to make a plane, and I want to pave tile on the plane. If can I get the
coordinate on the plane?
I write like this:


#declare Camera_Location = <6,2,5>;
#declare Plane_Color = <1,1,1>;
#declare Plane =
  plane{
    <0,1,0>, 0
  pigment{rgb Plane_Color}
  }

#declare Dist= vlength(trace(Plane, Camera_Location, <0,-1,0>)-Camera_Location);
#declare Tan = (X - Camera_Location.x)/Dist;
#if (Tan > 0)
  #local k = 0;
  #while (k < 10)
  #if (k<PX & X<(k+0.02-0.005*Tan))
  #declare Plane_Color = <0,0,0>;
  #end
  #local k = k + 1;
  #end
#else
  #local k = 0;
  #while (k < 10)
  #if (k<(X+0.005*Tan) & X<(k+0.02))
  #local Plane_Color = <0,0,0>;
  #end
  #local k = k + 1;
  #end
#end

camera{
location Camera_Location
look_at <0,0,2>
}

Plane


Because the gaps between the tile look smaller while it is far from the camera.
But I don't know the actual X while it render the image.
Thanks.


Post a reply to this message

From: Le Forgeron
Subject: Re: Can I get the coordinate?
Date: 10 Jul 2010 03:42:18
Message: <4c38245a$1@news.povray.org>
Le 10/07/2010 06:28, And nous fit lire :
> I want to make a plane, and I want to pave tile on the plane. If can I get the
> coordinate on the plane?
> I write like this:

> But I don't know the actual X while it render the image.
> Thanks.

I do not know what you are trying to achieve, but it looks like you want
to change the color of the plane afterhand... maybe a look at the
texture/pigment & pattern sections in the documentation might help you.

Povray has no concept of dynamic shader and it looks like you are used
to them.


Post a reply to this message

From: And
Subject: Re: Can I get the coordinate?
Date: 10 Jul 2010 04:20:01
Message: <web.4c382c6e64f93551cf51b3890@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> I do not know what you are trying to achieve, but it looks like you want
> to change the color of the plane afterhand... maybe a look at the
> texture/pigment & pattern sections in the documentation might help you.
>
> Povray has no concept of dynamic shader and it looks like you are used
> to them.

Thank you. I just want to draw the gap between the tiles. But I think they are
something like this:
_______________       _______________________________       _________________
               |_____|                               |_____|
This one is the plane with black line:
http://picasaweb.google.com/lh/photo/MrYRcPOAXjg3pmqDBol66Q?feat=directlink

This picture is what I am trying. Notice that the width of the line decrease
while it is far frome the camera:
http://picasaweb.google.com/lh/photo/WG3qxXgmTB4jyEFNoeLBvQ?feat=directlink

My English is poor, excuse me.


Post a reply to this message

From: Le Forgeron
Subject: Re: Can I get the coordinate?
Date: 10 Jul 2010 05:17:30
Message: <4c383aaa@news.povray.org>
Le 10/07/2010 10:16, And nous fit lire :
> Le_Forgeron <jgr### [at] freefr> wrote:
> 
>> I do not know what you are trying to achieve, but it looks like you want
>> to change the color of the plane afterhand... maybe a look at the
>> texture/pigment & pattern sections in the documentation might help you.
>>
>> Povray has no concept of dynamic shader and it looks like you are used
>> to them.
> 
> Thank you. I just want to draw the gap between the tiles. But I think they are
> something like this:
> _______________       _______________________________       _________________
>                |_____|                               |_____|
> This one is the plane with black line:
> http://picasaweb.google.com/lh/photo/MrYRcPOAXjg3pmqDBol66Q?feat=directlink
> 
> This picture is what I am trying. Notice that the width of the line decrease
> while it is far frome the camera:
> http://picasaweb.google.com/lh/photo/WG3qxXgmTB4jyEFNoeLBvQ?feat=directlink
> 
> My English is poor, excuse me.

No problem with your english.
Have a look at the brick pattern
 http://f-lohmueller.de/pov_tut/tex/tex_550e.htm

from above, it will be what you want.
(there is other way to do it, including warp and other patterns)

Now, you can also really tile a floor (plane) with actual tiles (box),
using two loops to cover the visible area.


Post a reply to this message

From: And
Subject: Re: Can I get the coordinate?
Date: 10 Jul 2010 06:20:00
Message: <web.4c38492264f93551cf51b3890@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> No problem with your english.
> Have a look at the brick pattern
>  http://f-lohmueller.de/pov_tut/tex/tex_550e.htm
>
> from above, it will be what you want.
> (there is other way to do it, including warp and other patterns)
>
> Now, you can also really tile a floor (plane) with actual tiles (box),
> using two loops to cover the visible area.

Well, I just somewhat be not willing to do this with so many boxes. And I want
to learn more about POV-Ray's SDL, and what it can do. But I can't find that in
the document.

Thank you.


Post a reply to this message

From: Jim Holsenback
Subject: Re: Can I get the coordinate?
Date: 10 Jul 2010 06:49:38
Message: <4c385042$1@news.povray.org>
On 07/10/2010 07:19 AM, And wrote:
> Le_Forgeron <jgr### [at] freefr> wrote:
> 
>> No problem with your english.
>> Have a look at the brick pattern
>>  http://f-lohmueller.de/pov_tut/tex/tex_550e.htm
>>
>> from above, it will be what you want.
>> (there is other way to do it, including warp and other patterns)
>>
>> Now, you can also really tile a floor (plane) with actual tiles (box),
>> using two loops to cover the visible area.
> 
> Well, I just somewhat be not willing to do this with so many boxes. And I want
> to learn more about POV-Ray's SDL, and what it can do. But I can't find that in
> the document.
> 
> Thank you.
> 
> 
you can also achieve somewhat satisfactory results using surface
normals, have a look at this slope map tutorial:

http://wiki.povray.org/content/Documentation:Tutorial_Section_3.3#Slope_Map_Tutorial


Post a reply to this message

From: And
Subject: Re: Can I get the coordinate?
Date: 10 Jul 2010 10:25:00
Message: <web.4c38827064f93551cf51b3890@news.povray.org>
Jim Holsenback <jho### [at] povrayorg> wrote:
> you can also achieve somewhat satisfactory results using surface
> normals, have a look at this slope map tutorial:
>
> http://wiki.povray.org/content/Documentation:Tutorial_Section_3.3#Slope_Map_Tutorial

Thank you.


Post a reply to this message

From: Alain
Subject: Re: Can I get the coordinate?
Date: 10 Jul 2010 21:39:57
Message: <4c3920ed$1@news.povray.org>

> Le_Forgeron<jgr### [at] freefr>  wrote:
>
>> No problem with your english.
>> Have a look at the brick pattern
>>   http://f-lohmueller.de/pov_tut/tex/tex_550e.htm
>>
>> from above, it will be what you want.
>> (there is other way to do it, including warp and other patterns)
>>
>> Now, you can also really tile a floor (plane) with actual tiles (box),
>> using two loops to cover the visible area.
>
> Well, I just somewhat be not willing to do this with so many boxes. And I want
> to learn more about POV-Ray's SDL, and what it can do. But I can't find that in
> the document.
>
> Thank you.
>
>
To place many tiles/boxes, you can easily use nested #while() loops
Sample:
union{ // place 1600 tiles
#declare IndX = -20;
#declare MaxX = 20;
#declare MaxZ = 20;
#while(IndX < MaxX)
   #declare IndZ = -20;
   #while(IndZ < MaxZ)
    box{<0.45,0.02,0.45>,<-0.45,-0.1, -0.45> translate <IndX, 0, IndZ>}
    #declare IndZ = IndZ + 1;
   #end
   #declare IndX = IndX +1;
#end
plane{y, 0 pigment{rgb 0.05}}// grout between the tiles
pigment{rgb 1}
}

You can also use layered textures on a plane:

texture{pigment{gradient z color_map{[0.1 rgb 0.05][0.1 rgb 1]}
// white base with black stripes
texture{pigment{gradient z color_map{[0.1 rgb 0.05][0.1 rgbt 1]}
// second set of black stripes
// The transparent part let the previous layer be visible



Alain


Post a reply to this message

From: And
Subject: Re: Can I get the coordinate?
Date: 13 Jul 2010 07:45:01
Message: <web.4c3c50f264f9355147ab14ad0@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
> To place many tiles/boxes, you can easily use nested #while() loops
> Sample:
> union{ // place 1600 tiles
> #declare IndX = -20;
> #declare MaxX = 20;
> #declare MaxZ = 20;
> #while(IndX < MaxX)
>    #declare IndZ = -20;
>    #while(IndZ < MaxZ)
>     box{<0.45,0.02,0.45>,<-0.45,-0.1, -0.45> translate <IndX, 0, IndZ>}
>     #declare IndZ = IndZ + 1;
>    #end
>    #declare IndX = IndX +1;
> #end
> plane{y, 0 pigment{rgb 0.05}}// grout between the tiles
> pigment{rgb 1}
> }
>
> You can also use layered textures on a plane:
>
> texture{pigment{gradient z color_map{[0.1 rgb 0.05][0.1 rgb 1]}
> // white base with black stripes
> texture{pigment{gradient z color_map{[0.1 rgb 0.05][0.1 rgbt 1]}
> // second set of black stripes
> // The transparent part let the previous layer be visible
>
>
>
> Alain


Thanks.

http://picasaweb.google.com/lh/photo/Q1u7dkph2ARvTlo5LU3FNg?feat=directlink


Post a reply to this message

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