News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

Can shapes be filled with a texture?

Started by thaaks, October 05, 2008, 05:24:10 PM

Previous topic - Next topic

thaaks

I was looking through the source code section, browsed the code tank and read the online help but didn't find any info.
The idea is to generate a level made of shapes and draw them filled with different textures (sand, rock, grass).

Is that doable with PB?

Cheers,
Tommy

kevin

 Shapes can't be texture mapped.  TextureTri,TExtureQuad,TextureStrip etc

thaaks

Thanks, Kevin.

Seems like the image is scaled or stretched to fit the TextureQuad. Would it be possible to tile and/cut the image if the TextureQuad is bigger or smaller?

My idea was to create something like a random seabed or cave ceiling and use a seamless procedural texture as an image. I would then create TextureQuads and TextureTris and appropriate Shapes (for the collision handling) to generate a random world for the game.
To make this look good the image with the seamless procedural texture (say sand or rock or lava) would need to be cut or tiled inside the TextureQuads and Tris so that the edges always fit smoothly.

Does that make sense?

Another option would be to use a map and generate tiles using the seamless procedural texture image and "fake" shapes by doing smart image copies to create "random formed" tiles.

But I thought Shapes and TextureQuads/Tris would a) look better and b) require less processor power for drawing and collision checking.

Opinions?

Thanks,
Tommy