I want to put different textures on a cube, like a six sided dice. How do I do this? I thought CreateCubeTexture() would do this, but it does not work. Then I tried creating two cubes with different textures and place them next to each other (to realize at least two different sides), but this doesn't work either and is surely totally wrong. Can someone give me a hint?
Shouldn't this example put a different texture on each cube side?
Code: Select all
InitEngine3D() : InitSprite() : InitKeyboard()
OpenWindow(0, 0,0, 800, 600, "VertexColour - [Esc] quit", #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), 0, 0, 0)
Add3DArchive(#PB_Compiler_Home + "Examples/3D/Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "Examples/3D/Data/Packs/desert.zip", #PB_3DArchive_Zip)
Parse3DScripts()
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0,0,0,-8)
CameraLookAt(0,0,0,0)
CreateLight(0,$ffffff, -100, 100, 50)
AmbientColor($111111*2)
CameraBackColor(0,$880044)
;SkyBox("desert07.jpg")
LoadTexture(0,"desert07_RT.jpg")
LoadTexture(1,"desert07_LF.jpg")
LoadTexture(2,"desert07_UP.jpg")
LoadTexture(3,"desert07_DN.jpg")
LoadTexture(4,"desert07_FR.jpg")
LoadTexture(5,"desert07_BK.jpg")
CreateCubicTexture(10, 0, 1, 2, 3, 4, 5)
LoadTexture(11, "dirt.jpg")
CreateMaterial(0, TextureID(11))
AddMaterialLayer(0, TextureID(10), #PB_Material_Add)
SetMaterialAttribute(0, #PB_Material_EnvironmentMap, #PB_Material_ReflectionMap, 1)
CreateCube(0,2)
CreateEntity(0, MeshID(0), MaterialID(0))
Repeat
While WindowEvent():Wend
ExamineKeyboard()
RotateEntity(0,1,1,1, #PB_Relative)
RenderWorld()
FlipBuffers()
Until KeyboardReleased(#PB_Key_Escape)