I have been attempting to paint a cuboid (a box shape) with different images on different sides with limited success. I made a box shape image in Wings, imported it to Ultimate Unwrap 3D (which I apprecaite probable has the power to apply images to individual sides - however its too powerful for me) then exported the box to a b3d file. I am loading the b3d box shape into b3d and attempting to apply different png files I have created within a paint application.
Can someone please tell me the method to pick individual sides of my cube and apply images to it..... I'm getting a feeling of deja vue but I haven't been coding for a while.
thanks in advance - once this is resolved I intend to make it a downloadable package which will contain the image file necessary to run this code, including the .b3d file - I'll also include the InnoSetup script containing the text necessary to create a downloadable package, someone might find that useful. (Innosetup is an excellent program that allows you to make installable applications....).
I appreciate this code won't run as I have not made the image files downloadable yet - I will once I have been able to pick the indivdual sides and apply the separate images.
Thanks in advance.....
Can someone please tell me the method to pick individual sides of my cube and apply images to it..... I'm getting a feeling of deja vue but I haven't been coding for a while.
thanks in advance - once this is resolved I intend to make it a downloadable package which will contain the image file necessary to run this code, including the .b3d file - I'll also include the InnoSetup script containing the text necessary to create a downloadable package, someone might find that useful. (Innosetup is an excellent program that allows you to make installable applications....).
;--- attempt to paint different sides of a box with different images ---- Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,2,-5 light=CreateLight() ;RotateEntity light,90,0,0 RotateEntity light,90,45,45 ; Load mesh box_3d=LoadMesh("C:/spell_box_b3d.b3d") brush_top = CreateBrush() brush_side = CreateBrush() brush_front = CreateBrush() brush_bottom = CreateBrush() ;try applying brushes to the top/side and bottom of the box tex_top=LoadTexture( "c:\top_box_200_x_80.png") tex_side=LoadTexture("c:\side_80_x_300.png" ) tex_bottom=LoadTexture("c:\bot_box_200_x_80.png" ) tex_front=LoadTexture( "c:\200_by_300.png" ) brush=CreateBrush() BrushTexture brush_top,tex_top,0,0 BrushTexture brush_side,tex_side,0,0 BrushTexture brush_front,tex_front,0,0 BrushTexture brush_bottom,tex_bottom,0,1 ;Cannot work out how to apply separate images to the top, sides & front ? PaintSurface GetSurface( box_3d, 1 ) , brush_top ;PaintSurface GetSurface( box_3d, 2 ) , brush_side PositionEntity box_3d,0,0,MeshDepth(box_3d)*2 While Not KeyDown( 1 ) If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0 If KeyDown( 203 )=True Then TurnEntity camera,0,1,0 If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05 If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05 ;move camera up and down If KeyDown( 30 )=True Then MoveEntity camera,0,1,0 ;a If KeyDown( 44 )=True Then MoveEntity camera,0,-1,0 ;z ; Change rotation values depending on the key pressed ;If KeyDown( 208 )=True Then pitch#=pitch#-1 ;If KeyDown( 200 )=True Then pitch#=pitch#+1 If KeyDown( 49 )=True Then yaw#=yaw#-1 If KeyDown( 50 )=True Then yaw#=yaw#+1 ;If KeyDown( 45 )=True Then roll#=roll#-1 ;If KeyDown( 44 )=True Then roll#=roll#+1 ; Rotate cone using rotation values RotateEntity box_3d,pitch#,yaw#,roll# RenderWorld Text 0,0,"Use cursor keys to move about" Text 0,20,"Use a/z for camera up/down" Text 0,40,"Use m/n for rotate the box" Flip Wend End
I appreciate this code won't run as I have not made the image files downloadable yet - I will once I have been able to pick the indivdual sides and apply the separate images.
Thanks in advance.....