POV-Ray : Newsgroups : povray.newusers : Help with "Endless" texture Server Time
2 Nov 2024 17:04:18 EDT (-0400)
  Help with "Endless" texture (Message 1 to 9 of 9)  
From: Pirate Lord
Subject: Help with "Endless" texture
Date: 29 Apr 2003 16:52:49
Message: <3eaee621@news.povray.org>
Hi,

very new user here :-)

Subject may sound a bit weird, but here is my problem.


I have an external routine that generates pov-code. The main aspect of it is
that it generates a pretty decent random texture.
This is shown on a rectangle that I have sized to fit the draw window as
close as possible.
I would like this texture to be applied so that when moving off the left of
the image, the texture carries on from the right.
Basically, like a textured cylinder that has been unrolled and flattened to
a rectangle.

Cheers for any advise, pointers, solutions, etc.


Post a reply to this message

From: Warp
Subject: Re: Help with "Endless" texture
Date: 29 Apr 2003 17:11:08
Message: <3eaeea6c@news.povray.org>
Pirate Lord <pir### [at] btinternetnospamcom> wrote:
> I would like this texture to be applied so that when moving off the left of
> the image, the texture carries on from the right.

  Seeing the current code you are using would help giving you a definite
answer (because by default an image map repeats itself, so if it doesn't
you must have done something to turn this default behaviour off).

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Pirate Lord
Subject: Re: Help with "Endless" texture
Date: 30 Apr 2003 14:58:29
Message: <3eb01cd5@news.povray.org>
Here is an extract of the relevant section, image produced at 320x240

#include "colors.inc"
camera {
     location <0, 0, -7>
     look_at 0
     angle 30
}
light_source { <1000, 1000, -1000> White }
#declare MyTex = texture {
     pigment {
          agate
          turbulence 0.75
          lambda 4
          omega 0.91
          octaves 10
          color_map {
               [0.000 color rgb <0.42,0.96,0.39>]
               [0.815 color rgb <0.35,0.77,0.26>]
               [1.000 color rgb <0.51,0.62,0.43>]
          }
     }
     normal {
          bozo
          turbulence 0.98
          lambda 1.1
          normal_map {
               [0.26 dents 2.78 scale 0.34]
               [0.62 agate turbulence 0.4]
               [1.00 dents 2.78 scale 0.34]
          }
     }
}
box {<-1.9,-1.45,0>,<1.9,1.45,0>
     texture {MyTex}
}

"Warp" <war### [at] tagpovrayorg> wrote in message
news:3eaeea6c@news.povray.org...
> Pirate Lord <pir### [at] btinternetnospamcom> wrote:
> > I would like this texture to be applied so that when moving off the left
of
> > the image, the texture carries on from the right.
>
>   Seeing the current code you are using would help giving you a definite
> answer (because by default an image map repeats itself, so if it doesn't
> you must have done something to turn this default behaviour off).
>
> --
> #macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb
M()}}
> N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
> N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  -
Warp -


Post a reply to this message

From: Tom & Lu Melly
Subject: Re: Help with "Endless" texture
Date: 1 May 2003 15:00:40
Message: <3eb16ed8@news.povray.org>
"Pirate Lord" <pir### [at] btinternetNOSPAMcom> wrote in
message news:3eb01cd5@news.povray.org...
> Here is an extract of the relevant section, image produced at 320x240
>

Oh, you want a tileable image.

Working on it....


Post a reply to this message

From: Pirate Lord
Subject: Re: Help with "Endless" texture
Date: 1 May 2003 15:36:13
Message: <3eb1772d$1@news.povray.org>
As long as the left + right match up.

This is what I am basically doing.

I have taken the planet example in the help file, and used that as a base
for generating random worlds, my code gives the option for a sphere, or for
a flat "map" which I am using in another program to produce a 3D rotating
world using this texture.

This image thus includes the landmass, oceans and clouds.

"Tom & Lu Melly" <all### [at] tomandlucouk> wrote in message
news:3eb16ed8@news.povray.org...
> "Pirate Lord" <pir### [at] btinternetNOSPAMcom> wrote in
> message news:3eb01cd5@news.povray.org...
> > Here is an extract of the relevant section, image produced at 320x240
> >
>
> Oh, you want a tileable image.
>
> Working on it....
>
>


Post a reply to this message

From: Tom & Lu Melly
Subject: Re: Help with "Endless" texture
Date: 1 May 2003 16:41:23
Message: <3eb18673@news.povray.org>
"Pirate Lord" <pir### [at] btinternetNOSPAMcom> wrote in
message news:3eb1772d$1@news.povray.org...
> As long as the left + right match up.
>
> This is what I am basically doing.

Here's one quick-fix (fairly easy to turn into a more flexible macro).

union{
  box {<-1.9,-1.45,0>,<1.9,1.45,-0.1> translate <1.901,1.451,0> scale 0.5
texture {MyTex}}
  box {<-1.9,-1.45,0>,<1.9,1.45,-0.1> translate <1.901,1.451,0> scale 0.5
texture {MyTex} scale x*-1}
  box {<-1.9,-1.45,0>,<1.9,1.45,-0.1> translate <1.901,1.451,0> scale 0.5
texture {MyTex} scale y*-1}
  box {<-1.9,-1.45,0>,<1.9,1.45,-0.1> translate <1.901,1.451,0> scale 0.5
texture {MyTex} scale <-1,-1,0>}
}


Post a reply to this message

From: Warp
Subject: Re: Help with "Endless" texture
Date: 1 May 2003 17:08:53
Message: <3eb18ce4@news.povray.org>
Tom & Lu Melly <all### [at] tomandlucouk> wrote:
> Oh, you want a tileable image.

  I didn't understand he wanted a tileable image either.

  There are several ways of doing this. For example like this:

// Makes a tileable texture from the given texture.
// The texture extends from <0,0> to <1,1>
#macro TileTexture(Texture)
  #local XTile =
    texture
    { gradient x texture_map
      { [0 Texture]
        [1 Texture translate x]
      }
    }
  #local a=0; // This is just a hack to avoid an issue with the parser
  texture
  { gradient y texture_map
    { [0 XTile]
      [1 XTile translate y]
    }
  }
#end

#declare Example =
  texture
  { pigment
    { granite color_map { [0 rgb <.4,.2,.1>][1 rgb <1,.8,.5>] }
    }
    finish { ambient 1 }
  }

box
{ 0, 1
  TileTexture(Example)
}

camera
{ right x location -z look_at 0
  translate <.5,.5>
}

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Tom & Lu Melly
Subject: Re: Help with "Endless" texture
Date: 3 May 2003 14:10:19
Message: <3eb4060b@news.povray.org>
"Tom & Lu Melly" <all### [at] tomandlucouk> wrote in message
news:3eb18673@news.povray.org...

<snip>

It does occur to me that the solution I posted might not be what you are
after, in that the image will be mirrored around two axis. If you want a
more natural tileable image, my only suggestion (but I'm sure that there are
others), would be a function that returned the same values at x*-1 as x*1 as
well as y*-1 and y*1.

Could a warp or something provide a more general solution? Anyone?


Post a reply to this message

From: Apache
Subject: Re: Help with "Endless" texture
Date: 17 May 2003 10:24:23
Message: <3ec64617$1@news.povray.org>
Try the ultri wide angle camera. You can use it for making tiling images.

camera {
  ultra_wide_angle
  location <0, 0, -.1>
  look_at  <0, 0, 0>
  right x*image_width/image_height
  angle 360
}


Post a reply to this message

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