How to apply two textures to two sides of a cube
Blitz3D Forums/Blitz3D Programming/How to apply two textures to two sides of a cube
| ||
I have created 100 cubes, more oblong rectangle shapes which represent cars 'bodies'. I wish to apply the numbers 0 to 99 to the top and bottom of each car. I plan to use 10 number images (0-9), to create the 0 to 99 textures, then identify the top and bottom of each oblong as I create each car body and apply the number to the top and bottom face once I have identified them. So I have my numbers, 1. Would I be better using gifs or pngs for the numbers. 2. How do I glue the numbers together to make a single texture (i.e. 3 next to 6 would make my 36 texture.) 3. How do I identify the top and bottom faces of my cubes. 4. How do I then apply the texture to the two identified faces? Thanks in advance, BP. |
| ||
1) Textures are best as PNGs (you can't use GIFs). 2) Can you not use 2 quads (replacing each cube face) with a digit on each? 3) Not sure. 4) Create a new quad surface with vertices at the same positions? |
| ||
thanks of to find out what a quad is (;-) |
| ||
quad = quadrangle = face = 2 triangles (and 4 vertices) |
| ||
This example shows a quad: Are you creating the meshes from code, or are you loading them from a file. And in that case, are you using LoadMesh or LoadAnimMesh ? |
| ||
The meshes are being created from code, thanks for the code example will fire up my Blitz PC when I get home and try it out. Right tried it out, added another mesh, so I suppose I somehow add my png(s) to each surf somehow ?:- |
| ||
Yes, maybe this example might be helpful: |
| ||
that code looks ideal, have gave it a whirl AND it does the job brilliantly. Thanks for the help. |