texuring a cube

Blitz3D Forums/Blitz3D Programming/texuring a cube

Chevron(Posted 2006) [#1]
If i have a 64x64 texture and want to apply this same texture to each individual face of a cube created with createcube() how do i go about this easily from within blitz.

In the past I have just used a 3d package for this but dont own one now.

Thanks in advance


Stevie G(Posted 2006) [#2]
Entitytexture Cube, texture will apply the same texture to each face ... unless you mean something else?

Stevie


Chevron(Posted 2006) [#3]
Ah right, I was under the impression that it would wrap the 64x64 texture around the whole cube. If thats the case, thats fine an easy fix. I dont usually use the blitz mesh commands, so please excuse my ignorance.

Thanks for the help.


octothorpe(Posted 2006) [#4]
You need to set UV coordinates.

UV coordinates dictate which parts of your texture will be painted onto which triangles. By default, every face of a cube has the same UV coordinates. Look into VertexTexCoords.


John Blackledge(Posted 2006) [#5]
Er, octo, if all he wants to do is apply say a 'crate' texture to a cube then Entitytexture Cube, texture will work fine.
Chevron, UV coords are only necessary if you need to rotate etc the texture on particular faces.


Chevron(Posted 2006) [#6]
Thanks a lot for the info guys, working fine.


octothorpe(Posted 2006) [#7]
UV coords are only necessary if you need to rotate etc the texture on particular faces.


Incorrect. By far, a more common usage of UV coords is to select parts of one big texture so you don't end up with a lot of tiny textures (e.g. for eyes and ears.)