I created a cube and I want to be able to texture it on differnet side with a differnet texture. is there a way to do that? Tired of making plain and forming into a cube lol
nack
nack
Function createcubebrush(rectbrush_widthw,rectbrush_heighth,rectbrush_depthd) mainbrush = CreateMesh() surf = CreateSurface(mainbrush) v1handle = AddVertex (surf, 0,0,0, 0 ,0) v2handle = AddVertex (surf, rectbrush_widthw,0,0, 1 ,0) v3handle = AddVertex (surf, 0, rectbrush_heighth,0, 0,1) tri = AddTriangle (surf,v1handle,v3handle,v2handle) v1handle = AddVertex (surf, rectbrush_widthw,rectbrush_heighth,0, 1 ,1) tri = AddTriangle (surf,v1handle,v2handle,v3handle) surf = CreateSurface(mainbrush) v1handle = AddVertex (surf, 0,0,rectbrush_depthd, 0 ,0) v2handle = AddVertex (surf, rectbrush_widthw,0,rectbrush_depthd, 1 ,0) v3handle = AddVertex (surf, 0, rectbrush_heighth,rectbrush_depthd, 0,1) tri = AddTriangle (surf,v1handle,v2handle,v3handle) v1handle = AddVertex (surf, rectbrush_widthw,rectbrush_heighth,rectbrush_depthd, 1 ,1) tri = AddTriangle (surf,v3handle,v2handle,v1handle) surf = CreateSurface(mainbrush) v1handle = AddVertex (surf, rectbrush_widthw,0,0, 0 ,0) v2handle = AddVertex (surf, rectbrush_widthw,0,rectbrush_depthd, 1 ,0) v3handle = AddVertex (surf, rectbrush_widthw, rectbrush_heighth,0, 0,1) tri = AddTriangle (surf,v1handle,v3handle,v2handle) v1handle = AddVertex (surf, rectbrush_widthw,rectbrush_heighth,rectbrush_depthd, 1 ,1) tri = AddTriangle (surf,v1handle,v2handle,v3handle) surf = CreateSurface(mainbrush) v1handle = AddVertex (surf, 0,0,0, 0 ,0) v2handle = AddVertex (surf, 0,0,rectbrush_depthd, 1 ,0) v3handle = AddVertex (surf, 0, rectbrush_heighth,rectbrush_depthd, 1,1) tri = AddTriangle (surf,v1handle,v2handle,v3handle) v1handle = AddVertex (surf, 0,rectbrush_heighth,0, 0 ,1) tri = AddTriangle (surf,v1handle,v2handle,v3handle) surf = CreateSurface(mainbrush) v1handle = AddVertex (surf, 0,0,0, 0 ,1) v2handle = AddVertex (surf, 0,0,rectbrush_depthd, 0 ,0) v3handle = AddVertex (surf, rectbrush_widthw,0,0, 1,1) tri = AddTriangle (surf,v1handle,v3handle,v2handle) v1handle = AddVertex (surf, rectbrush_widthw,0,rectbrush_depthd, 1 ,0) tri = AddTriangle (surf,v1handle,v2handle,v3handle) surf = CreateSurface(mainbrush) v1handle = AddVertex (surf, 0,rectbrush_heighth,0, 0 ,1) v2handle = AddVertex (surf, 0,rectbrush_heighth,rectbrush_depthd, 0 ,0) v3handle = AddVertex (surf, rectbrush_widthw,rectbrush_heighth,rectbrush_depthd, 1,0) tri = AddTriangle (surf,v1handle,v2handle,v3handle) v1handle = AddVertex (surf, rectbrush_widthw,rectbrush_heighth,0, 1 ,1) tri = AddTriangle (surf,v1handle,v2handle,v3handle) Return mainbrush End Function
Graphics3D 800, 600, 0, 0 SetBuffer BackBuffer() ; generate 10.000 quads as individual meshes (and also surfaces as each mesh has it's own surface) ;For i = 1 To 10000 ; mesh = CreateMesh() ; surf = CreateSurface(mesh) ; v0 = AddVertex(surf, -1, 0, -1) ; v1 = AddVertex(surf, -1, 0, 1) ; v2 = AddVertex(surf, 1, 0, 1) ; v3 = AddVertex(surf, 1, 0, -1) ; t0 = AddTriangle(surf, v3, v0, v1) ; t1 = AddTriangle(surf, v1, v2, v3) ;Next ; generate one mesh with 10.000 quads on the same surface Global mesh = CreateMesh() Global surf = CreateSurface(mesh) For i = 1 To 10000 v0 = AddVertex(surf, -1, 0, -1) v1 = AddVertex(surf, -1, 0, 1) v2 = AddVertex(surf, 1, 0, 1) v3 = AddVertex(surf, 1, 0, -1) t0 = AddTriangle(surf, v3, v0, v1) t1 = AddTriangle(surf, v1, v2, v3) Next camera = CreateCamera() PositionEntity camera, 0, 10, 0 RotateEntity camera, 90, 0, 0 While Not KeyHit(1) RenderWorld Flip False Wend End