Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Texture each side of a cube with different image

Author
Message
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 6th May 2005 00:37
With 5.8 we can now play with vertices and uv data, so you can load in an image with 6 textures in it laid out like:

123
456

and then get DBPro to assign each face of a cube the relevant part of your loaded image.

This code will make the image so you can see how it works, but you can get rid of the texture making bit and just load in your own image.



The only slight problem I have, which I hope someone can explain is you can see part of adjacent images on the very edge of some of the faces. This is because I don't know what to set uv data to be.

e.g. face 1 should have topleft uv of 0,0 and bottom right uv of third,half. But I assume it should be 'just under' the third and half, otherwise right side of face 1 will have a bit of texture 2, and bottom of face 1 will have a bit of texture 4.

So, if face 2 starts at 0.5, what should face one end at???

Boo!
NoteJam
20
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 6th May 2005 15:51
Great code spooky! Now we might be able to make it a photo cube with family pics displayed. I would like some way to hide the background so we only see the cube, with drawings or photos. Maybe even 6 avi movies showing at the same time, lol Call it HexPlex Cinama.
NoteJam
20
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 7th May 2005 11:50
Little boxs, Little boxs, and they are all made of ticky tacky, BUT THEY ALL DO NOT LOOK THE SAME!

My mod of your program gives a different cube kalidoscope crystal gallery each time you run the program.

Login to post a reply

Server time is: 2025-08-08 15:33:41
Your offset time is: 2025-08-08 15:33:41