POV-Ray : Newsgroups : povray.general : Repeating texture sprite Server Time
29 Apr 2024 13:54:38 EDT (-0400)
  Repeating texture sprite (Message 16 to 25 of 25)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: Repeating texture sprite
Date: 1 Mar 2016 08:40:01
Message: <web.56d59b683999a405e7df57c0@news.povray.org>
"Go go POV-Ray newsgroup!"
"Activate: Colefax Include file!"

:O

Thanks for all the links.
There's a bunch of includes I'm sure I'll love playing with.


Post a reply to this message

From: Bald Eagle
Subject: Re: Repeating texture sprite
Date: 1 Mar 2016 10:05:01
Message: <web.56d5af013999a405e7df57c0@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:

> I played around with this a bit. It seems it creates images that can be
> imported and used in subsequent scenes as repeating textures, but not
> repeating flat textures that can be used within the *same* scene. Unless
> I'm missing something.
>
>
> Mike

I guess I'm not quite following what exactly it is that you're trying to
accomplish.
Could you expand upon what "... but not repeating flat textures that can be used
within the *same* scene" means?

I sliced up that little island/water jpg and played around with the tiles, but
it's not clear to me how you're intending to arrange them.  There are only 8
tiles, whereas I _did_ understand the logic behind the 9-tile system that
Anthony posted.  I couldn't get those tiles to do much, and after using 6, I
only had a choppy cubist reef and 2 extra tiles that seemed unusable or
redundant.

Maybe throw together a diagram or two to illustrate the goal - even if it's on
real quick on paper and photographed with a cellphone.  ;)


Post a reply to this message

From: Bald Eagle
Subject: Re: Repeating texture sprite
Date: 1 Mar 2016 10:30:00
Message: <web.56d5b49c3999a405e7df57c0@news.povray.org>
http://www.jazz2online.com/tilesets/programs.php

http://www.verycomputer.com/275_080d1f45e2064eba_1.htm

Just posting these here - because.  :D


Post a reply to this message

From: Mike Horvath
Subject: Re: Repeating texture sprite
Date: 1 Mar 2016 12:03:05
Message: <56d5cb49$1@news.povray.org>
On 3/1/2016 10:02 AM, Bald Eagle wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
>
>> I played around with this a bit. It seems it creates images that can be
>> imported and used in subsequent scenes as repeating textures, but not
>> repeating flat textures that can be used within the *same* scene. Unless
>> I'm missing something.
>>
>>
>> Mike
>
> I guess I'm not quite following what exactly it is that you're trying to
> accomplish.
> Could you expand upon what "... but not repeating flat textures that can be used
> within the *same* scene" means?
>

I want to create an flat textured object (such as a polygon or plane) 
that is parallel to the ground; and that through clever manipulation 
within POV-Ray itself can be used to create a series of frames like this:

http://uploads.gamedev.net/monthly_06_2011/ccs-8549-0-57863900-1307467523.gif

Except that I want them to be isometric. Think in terms of the old 
strategy game Civilization II.

Here's an image chosen at random using Google that shows what an 
isometric game sprite looks like:

https://s-media-cache-ak0.pinimg.com/736x/84/25/bb/8425bb96e5bcb75a8ef3a9c8fbde1bd2.jpg

If you look at Chris Colefax's Tile Generator carefully, you'll find it 
creates a 3D scene - not a 2D scene - that is meant to be looked at from 
one and only one direction. Therefore, I cannot use it in an isometric 
scene.

I want to do 99% of the work in POV-Ray, not using some third-party tool 
or Photoshop.

A short recap:

1. The object needs to be a flat textured POV-Ray object - maybe a 
polygon - that is parallel with the ground.
2. By translating the object, its texture or the camera it should 
produce a sprite suitable for use in an isometric video game.
3. The texture needs to repeat in such a way that when several of these 
sprites are arranged next to each other, the transition will be seamless.
4. I want to use POV-Ray as much as possible instead of relying on 
external tools.


> I sliced up that little island/water jpg and played around with the tiles,

What jpg are you talking about?


  but
> it's not clear to me how you're intending to arrange them.  There are only 8
> tiles, whereas I _did_ understand the logic behind the 9-tile system that
> Anthony posted.  I couldn't get those tiles to do much, and after using 6, I
> only had a choppy cubist reef and 2 extra tiles that seemed unusable or
> redundant.
>
> Maybe throw together a diagram or two to illustrate the goal - even if it's on
> real quick on paper and photographed with a cellphone.  ;)
>
>
>
>
>


Post a reply to this message

From: Mike Horvath
Subject: Re: Repeating texture sprite
Date: 1 Mar 2016 12:17:44
Message: <56d5ceb8$1@news.povray.org>
On 2/29/2016 10:49 AM, Bald Eagle wrote:
> http://www.mapeditor.org/    looked interesting if you're doing that kind of
> work.

I looked at this too, and I can't tell if it's capable of creating all 
32 of the sprites stipulated in the first article I linked to. I think 
it just creates a smaller subset of them.


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Repeating texture sprite
Date: 1 Mar 2016 18:00:43
Message: <56d61f1b$1@news.povray.org>
On 3/1/2016 12:03 PM, Mike Horvath wrote:
> On 3/1/2016 10:02 AM, Bald Eagle wrote:
>> Mike Horvath <mik### [at] gmailcom> wrote:
>>
>>> I played around with this a bit. It seems it creates images that can be
>>> imported and used in subsequent scenes as repeating textures, but not
>>> repeating flat textures that can be used within the *same* scene. Unless
>>> I'm missing something.
>>>
>>>
>>> Mike
>>
>> I guess I'm not quite following what exactly it is that you're trying to
>> accomplish.
>> Could you expand upon what "... but not repeating flat textures that
>> can be used
>> within the *same* scene" means?
>>
>
> I want to create an flat textured object (such as a polygon or plane)
> that is parallel to the ground; and that through clever manipulation
> within POV-Ray itself can be used to create a series of frames like this:
>
> http://uploads.gamedev.net/monthly_06_2011/ccs-8549-0-57863900-1307467523.gif
>
>
> Except that I want them to be isometric. Think in terms of the old
> strategy game Civilization II.
>
> Here's an image chosen at random using Google that shows what an
> isometric game sprite looks like:
>
>
https://s-media-cache-ak0.pinimg.com/736x/84/25/bb/8425bb96e5bcb75a8ef3a9c8fbde1bd2.jpg
>
>
> If you look at Chris Colefax's Tile Generator carefully, you'll find it
> creates a 3D scene - not a 2D scene - that is meant to be looked at from
> one and only one direction. Therefore, I cannot use it in an isometric
> scene.
>
> I want to do 99% of the work in POV-Ray, not using some third-party tool
> or Photoshop.
>
> A short recap:
>
> 1. The object needs to be a flat textured POV-Ray object - maybe a
> polygon - that is parallel with the ground.
> 2. By translating the object, its texture or the camera it should
> produce a sprite suitable for use in an isometric video game.
> 3. The texture needs to repeat in such a way that when several of these
> sprites are arranged next to each other, the transition will be seamless.
> 4. I want to use POV-Ray as much as possible instead of relying on
> external tools.
>
>
>> I sliced up that little island/water jpg and played around with the
>> tiles,
>
> What jpg are you talking about?
>
>
>   but
>> it's not clear to me how you're intending to arrange them.  There are
>> only 8
>> tiles, whereas I _did_ understand the logic behind the 9-tile system that
>> Anthony posted.  I couldn't get those tiles to do much, and after
>> using 6, I
>> only had a choppy cubist reef and 2 extra tiles that seemed unusable or
>> redundant.
>>
>> Maybe throw together a diagram or two to illustrate the goal - even if
>> it's on
>> real quick on paper and photographed with a cellphone.  ;)
>>
>>
>>
>>
>>
>


An important first step would be to get POV-Ray to make a tiling texture {}.


Mike


Post a reply to this message

From: Bald Eagle
Subject: Re: Repeating texture sprite
Date: 1 Mar 2016 20:05:07
Message: <web.56d63bc03999a405e7df57c0@news.povray.org>
#version 3.7;
global_settings { assumed_gamma 1.0 }

//------------------------------------------
// SDL for generating Isometric View Game Tiles
// Bill Walker - 2016
//------------------------------------------

#include "colors.inc"
#include "debug.inc"
 Set_Debug (true)
#include "math.inc"
#include "rand.inc"
#include "shapes.inc"
#include "metals.inc"
#include "transforms.inc"

//###############################################
#declare XImageSize = 1024;
#declare YImageSize = 768;
//###############################################

light_source { <0, 50, 0>  color rgb <1, 1, 1>}

#declare Camera_Iso = camera {
                            location  <0, 0, -12>
                            //right    x*image_width/image_height
                            look_at   <0, 0, 0>
                            rotate x*30 rotate y*45 }


camera {Camera_Iso}

sky_sphere { pigment {Blue} }

//=====================================================================================================================
==

#declare TileTexture =
pigment {cylindrical frequency 1 turbulence 0
         color_map {[0.0 color Green * 0.5]
            [0.3 color Green * 0.5]
            [0.8 color Yellow * 0.1]
                    [1.0 color Yellow * 0.1]
  }//end of color_map
} // end of pigment

#declare Scale = 3;

#declare TileBox = box { 0, 1 translate <-0.5, -0.5, -0.5> pigment {TileTexture}
scale <Scale, 0.01, Scale>}

#declare PlainBox = box { 0, 1 translate <-0.5, -0.5, -0.5>}

#declare Box1 = intersection {object {PlainBox translate <-1, 0,  1>} object
{TileBox}}
#declare Box2 = intersection {object {PlainBox translate < 0, 0,  1>} object
{TileBox}}
#declare Box3 = intersection {object {PlainBox translate < 1, 0,  1>} object
{TileBox}}
#declare Box4 = intersection {object {PlainBox translate <-1, 0,  0>} object
{TileBox}}
#declare Box5 = intersection {object {PlainBox translate < 0, 0,  0>} object
{TileBox}}
#declare Box6 = intersection {object {PlainBox translate < 1, 0,  0>} object
{TileBox}}
#declare Box7 = intersection {object {PlainBox translate <-1, 0, -1>} object
{TileBox}}
#declare Box8 = intersection {object {PlainBox translate < 0, 0, -1>} object
{TileBox}}
#declare Box9 = intersection {object {PlainBox translate < 1, 0, -1>} object
{TileBox}}


//=============================


#declare Spacing = 0.1;


#local NrX = -1;     // start x
#local EndNrX = 2; // end   x
#while (NrX < EndNrX)

 #local NrZ = -1;     // start z
 #local EndNrZ = 1; // end   z
 #while (NrZ < EndNrZ)

  object{Box1 translate <Scale * NrX, 0, Scale * NrZ>}
  object{Box2 translate <Scale * NrX, 0, Scale * NrZ>}
  object{Box3 translate <Scale * NrX, 0, Scale * NrZ>}
  object{Box4 translate <Scale * NrX, 0, Scale * NrZ>}
  object{Box5 translate <Scale * NrX, 0, Scale * NrZ>}
  object{Box6 translate <Scale * NrX, 0, Scale * NrZ>}
  object{Box7 translate <Scale * NrX, 0, Scale * NrZ>}
  object{Box8 translate <Scale * NrX, 0, Scale * NrZ>}
  object{Box9 translate <Scale * NrX, 0, Scale * NrZ>}

  #local NrZ = NrZ + 1+Spacing;  // next Nr z
 #end // --------------- end of loop z

#declare NrX = NrX + 1+Spacing;  // next Nr x
#end // --------------- end of loop x


// 1,3,7,9
  object{Box1 translate <Scale * NrX, 0, Scale * NrZ>}
  object{Box3 translate <Scale * NrX-1, 0, Scale * NrZ>}
  object{Box7 translate <Scale * NrX, 0, Scale * NrZ+1>}
  object{Box9 translate <Scale * NrX-1, 0, Scale * NrZ+1>}

// 1,2,3,7,8,9
  object{Box1 translate <Scale * (NrX-2), 0, Scale * NrZ>}
  object{Box2 translate <Scale * (NrX-2), 0, Scale * NrZ>}
  object{Box3 translate <Scale * (NrX-2), 0, Scale * NrZ>}

  object{Box7 translate <Scale * (NrX-2), 0, Scale * NrZ+1>}
  object{Box8 translate <Scale * (NrX-2), 0, Scale * NrZ+1>}
  object{Box9 translate <Scale * (NrX-2), 0, Scale * NrZ+1>}


// 9, 7, 3, 1
  object{Box9 translate <Scale * (NrX-4), 0, Scale * NrZ+1>}
  object{Box7 translate <Scale * (NrX-3), 0, Scale * NrZ+1>}
  object{Box3 translate <Scale * (NrX-4), 0, Scale * NrZ>}
  object{Box1 translate <Scale * (NrX-3), 0, Scale * NrZ>}


Post a reply to this message

From: Bald Eagle
Subject: Re: Repeating texture sprite
Date: 1 Mar 2016 21:35:01
Message: <web.56d6506f3999a405e7df57c0@news.povray.org>
I even looked up how to get the background of the sprite to be transparent if
you need that:

Use the command-line option +ua
(good to know!   :)  )

http://news.povray.org/povray.newusers/message/%3C48a89167%40news.povray.org%3E/#%3C48a89167%40news.povray.org%3E


Post a reply to this message

From: Mike Horvath
Subject: Re: Repeating texture sprite
Date: 3 Mar 2016 00:43:19
Message: <56d7cef7$1@news.povray.org>
On 3/1/2016 8:02 PM, Bald Eagle wrote:
> #version 3.7;
> global_settings { assumed_gamma 1.0 }
>
> //------------------------------------------
> // SDL for generating Isometric View Game Tiles
> // Bill Walker - 2016
> //------------------------------------------
>
> #include "colors.inc"
> #include "debug.inc"
>   Set_Debug (true)
> #include "math.inc"
> #include "rand.inc"
> #include "shapes.inc"
> #include "metals.inc"
> #include "transforms.inc"
>
> //###############################################
> #declare XImageSize = 1024;
> #declare YImageSize = 768;
> //###############################################
>
> light_source { <0, 50, 0>  color rgb <1, 1, 1>}
>
> #declare Camera_Iso = camera {
>                              location  <0, 0, -12>
>                              //right    x*image_width/image_height
>                              look_at   <0, 0, 0>
>                              rotate x*30 rotate y*45 }
>
>
> camera {Camera_Iso}
>
> sky_sphere { pigment {Blue} }
>
>
//=====================================================================================================================
> ==
>
> #declare TileTexture =
> pigment {cylindrical frequency 1 turbulence 0
>           color_map {[0.0 color Green * 0.5]
>              [0.3 color Green * 0.5]
>              [0.8 color Yellow * 0.1]
>                      [1.0 color Yellow * 0.1]
>    }//end of color_map
> } // end of pigment
>
> #declare Scale = 3;
>
> #declare TileBox = box { 0, 1 translate <-0.5, -0.5, -0.5> pigment {TileTexture}
> scale <Scale, 0.01, Scale>}
>
> #declare PlainBox = box { 0, 1 translate <-0.5, -0.5, -0.5>}
>
> #declare Box1 = intersection {object {PlainBox translate <-1, 0,  1>} object
> {TileBox}}
> #declare Box2 = intersection {object {PlainBox translate < 0, 0,  1>} object
> {TileBox}}
> #declare Box3 = intersection {object {PlainBox translate < 1, 0,  1>} object
> {TileBox}}
> #declare Box4 = intersection {object {PlainBox translate <-1, 0,  0>} object
> {TileBox}}
> #declare Box5 = intersection {object {PlainBox translate < 0, 0,  0>} object
> {TileBox}}
> #declare Box6 = intersection {object {PlainBox translate < 1, 0,  0>} object
> {TileBox}}
> #declare Box7 = intersection {object {PlainBox translate <-1, 0, -1>} object
> {TileBox}}
> #declare Box8 = intersection {object {PlainBox translate < 0, 0, -1>} object
> {TileBox}}
> #declare Box9 = intersection {object {PlainBox translate < 1, 0, -1>} object
> {TileBox}}
>
>
> //=============================
>
>
> #declare Spacing = 0.1;
>
>
> #local NrX = -1;     // start x
> #local EndNrX = 2; // end   x
> #while (NrX < EndNrX)
>
>   #local NrZ = -1;     // start z
>   #local EndNrZ = 1; // end   z
>   #while (NrZ < EndNrZ)
>
>    object{Box1 translate <Scale * NrX, 0, Scale * NrZ>}
>    object{Box2 translate <Scale * NrX, 0, Scale * NrZ>}
>    object{Box3 translate <Scale * NrX, 0, Scale * NrZ>}
>    object{Box4 translate <Scale * NrX, 0, Scale * NrZ>}
>    object{Box5 translate <Scale * NrX, 0, Scale * NrZ>}
>    object{Box6 translate <Scale * NrX, 0, Scale * NrZ>}
>    object{Box7 translate <Scale * NrX, 0, Scale * NrZ>}
>    object{Box8 translate <Scale * NrX, 0, Scale * NrZ>}
>    object{Box9 translate <Scale * NrX, 0, Scale * NrZ>}
>
>    #local NrZ = NrZ + 1+Spacing;  // next Nr z
>   #end // --------------- end of loop z
>
> #declare NrX = NrX + 1+Spacing;  // next Nr x
> #end // --------------- end of loop x
>
>
> // 1,3,7,9
>    object{Box1 translate <Scale * NrX, 0, Scale * NrZ>}
>    object{Box3 translate <Scale * NrX-1, 0, Scale * NrZ>}
>    object{Box7 translate <Scale * NrX, 0, Scale * NrZ+1>}
>    object{Box9 translate <Scale * NrX-1, 0, Scale * NrZ+1>}
>
> // 1,2,3,7,8,9
>    object{Box1 translate <Scale * (NrX-2), 0, Scale * NrZ>}
>    object{Box2 translate <Scale * (NrX-2), 0, Scale * NrZ>}
>    object{Box3 translate <Scale * (NrX-2), 0, Scale * NrZ>}
>
>    object{Box7 translate <Scale * (NrX-2), 0, Scale * NrZ+1>}
>    object{Box8 translate <Scale * (NrX-2), 0, Scale * NrZ+1>}
>    object{Box9 translate <Scale * (NrX-2), 0, Scale * NrZ+1>}
>
>
> // 9, 7, 3, 1
>    object{Box9 translate <Scale * (NrX-4), 0, Scale * NrZ+1>}
>    object{Box7 translate <Scale * (NrX-3), 0, Scale * NrZ+1>}
>    object{Box3 translate <Scale * (NrX-4), 0, Scale * NrZ>}
>    object{Box1 translate <Scale * (NrX-3), 0, Scale * NrZ>}
>
>
>
>
>
>
>


I don't understand. What am I looking at here?


Mike


Post a reply to this message

From: Bald Eagle
Subject: Re: Repeating texture sprite
Date: 3 Mar 2016 09:30:01
Message: <web.56d8499e3999a405e7df57c0@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:
> I don't understand. What am I looking at here?

Continuous smoothly textured infinitely tessellating isometric tiles?

Replace the yellow and the green pigments with more complex textures, and that
seems PRETTY close to what you want.  Probably need to use orthographic camera
to get it exact.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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