Got it. Well, not what you just said, but I'll try that tonight. But I wrote this last night. You just need a wall texture to run it, like the last one.
Okay, here's the thing. I don't actually mind writing tedious code like this believe it or not. I like getting a good coffee buzz on and basically just duplicating everything over and over til it's done. The only thing I'm worried about is, the above code is for just one level element, and my engine will have 32, plus a few more to be used as area change triggers, door openers, etc., all told about 50 elements. Like I said, I don't mind coding all that, but wouldn't all that create some lag? Or is 1200 vertexes 1200 vertexes either way? What I mean is, is there a difference in speed between a level made up of normal meshes totaling 1200, and one made up of highly editable ones like mine totaling 1200? The reason I'm wondering that is not so much because I'm worried about slowdown while editing, but because when an area's done and being played, the vertexes and surfaces would all still have the same long names. I like them to be descriptive since there's so much to keep track of, but would all those names piled up cause problems, or is that nothing to a processor?
Okay, this concludes my embarrassing post for today! :)
Graphics3D 640,480,32,1 SetBuffer BackBuffer() ArialBold=LoadFont("arial",14,1,0,0) SetFont ArialBold Color 127,127,127 camera=CreateCamera() light=CreateLight() mesh=CreateMesh() elementtexture=LoadTexture("elementtexture.png") MoveEntity mesh,0,0,5 EntityFX mesh,1+16 EntityAlpha mesh,.5 TurnEntity mesh,0,-30,0 ; Top topsurfacevertex1position#=-1 topsurfacevertex1height#= 1 topsurfacevertex1distance#= 1 topsurfacevertex2position#= 1 topsurfacevertex2height#= 1 topsurfacevertex2distance#= 1 topsurfacevertex3position#=-1 topsurfacevertex3height#= 1 topsurfacevertex3distance#=-1 topsurfacevertex4position#= 1 topsurfacevertex4height#= 1 topsurfacevertex4distance#=-1 topsurface=CreateSurface(mesh) topsurfacevertex1=AddVertex(topsurface,topsurfacevertex1position,topsurfacevertex1height,topsurfacevertex1distance,0,0) topsurfacevertex2=AddVertex(topsurface,topsurfacevertex2position,topsurfacevertex2height,topsurfacevertex2distance,1,0) topsurfacevertex3=AddVertex(topsurface,topsurfacevertex3position,topsurfacevertex3height,topsurfacevertex3distance,0,1) topsurfacevertex4=AddVertex(topsurface,topsurfacevertex4position,topsurfacevertex4height,topsurfacevertex4distance,1,1) AddTriangle topsurface,topsurfacevertex1,topsurfacevertex2,topsurfacevertex3 AddTriangle topsurface,topsurfacevertex2,topsurfacevertex4,topsurfacevertex3 ; Back backsurfacevertex1position#=-1 backsurfacevertex1height#= 1 backsurfacevertex1distance#= 1 backsurfacevertex2position#= 1 backsurfacevertex2height#= 1 backsurfacevertex2distance#= 1 backsurfacevertex3position#=-1 backsurfacevertex3height#= -1 backsurfacevertex3distance#= 1 backsurfacevertex4position#= 1 backsurfacevertex4height#= -1 backsurfacevertex4distance#= 1 backsurface=CreateSurface(mesh) backsurfacevertex1=AddVertex(backsurface,backsurfacevertex1position,backsurfacevertex1height,backsurfacevertex1distance,0,0) backsurfacevertex2=AddVertex(backsurface,backsurfacevertex2position,backsurfacevertex2height,backsurfacevertex2distance,1,0) backsurfacevertex3=AddVertex(backsurface,backsurfacevertex3position,backsurfacevertex3height,backsurfacevertex3distance,0,1) backsurfacevertex4=AddVertex(backsurface,backsurfacevertex4position,backsurfacevertex4height,backsurfacevertex4distance,1,1) AddTriangle backsurface,backsurfacevertex1,backsurfacevertex2,backsurfacevertex3 AddTriangle backsurface,backsurfacevertex2,backsurfacevertex4,backsurfacevertex3 ; Left leftsurfacevertex1position#=-1 leftsurfacevertex1height#= 1 leftsurfacevertex1distance#=-1 leftsurfacevertex2position#=-1 leftsurfacevertex2height#= 1 leftsurfacevertex2distance#= 1 leftsurfacevertex3position#=-1 leftsurfacevertex3height#= -1 leftsurfacevertex3distance#=-1 leftsurfacevertex4position#=-1 leftsurfacevertex4height#= -1 leftsurfacevertex4distance#= 1 leftsurface=CreateSurface(mesh) leftsurfacevertex1=AddVertex(leftsurface,leftsurfacevertex1position,leftsurfacevertex1height,leftsurfacevertex1distance,0,0) leftsurfacevertex2=AddVertex(leftsurface,leftsurfacevertex2position,leftsurfacevertex2height,leftsurfacevertex2distance,1,0) leftsurfacevertex3=AddVertex(leftsurface,leftsurfacevertex3position,leftsurfacevertex3height,leftsurfacevertex3distance,0,1) leftsurfacevertex4=AddVertex(leftsurface,leftsurfacevertex4position,leftsurfacevertex4height,leftsurfacevertex4distance,1,1) AddTriangle leftsurface,leftsurfacevertex1,leftsurfacevertex2,leftsurfacevertex3 AddTriangle leftsurface,leftsurfacevertex2,leftsurfacevertex4,leftsurfacevertex3 ; Right rightsurfacevertex1position#= 1 rightsurfacevertex1height#= 1 rightsurfacevertex1distance#= 1 rightsurfacevertex2position#= 1 rightsurfacevertex2height#= 1 rightsurfacevertex2distance#=-1 rightsurfacevertex3position#= 1 rightsurfacevertex3height#= -1 rightsurfacevertex3distance#= 1 rightsurfacevertex4position#= 1 rightsurfacevertex4height#= -1 rightsurfacevertex4distance#=-1 rightsurface=CreateSurface(mesh) rightsurfacevertex1=AddVertex(rightsurface,rightsurfacevertex1position,rightsurfacevertex1height,rightsurfacevertex1distance,0,0) rightsurfacevertex2=AddVertex(rightsurface,rightsurfacevertex2position,rightsurfacevertex2height,rightsurfacevertex2distance,1,0) rightsurfacevertex3=AddVertex(rightsurface,rightsurfacevertex3position,rightsurfacevertex3height,rightsurfacevertex3distance,0,1) rightsurfacevertex4=AddVertex(rightsurface,rightsurfacevertex4position,rightsurfacevertex4height,rightsurfacevertex4distance,1,1) AddTriangle rightsurface,rightsurfacevertex1,rightsurfacevertex2,rightsurfacevertex3 AddTriangle rightsurface,rightsurfacevertex2,rightsurfacevertex4,rightsurfacevertex3 ; Front frontsurfacevertex1position#=-1 frontsurfacevertex1height#= 1 frontsurfacevertex1distance#=-1 frontsurfacevertex2position#= 1 frontsurfacevertex2height#= 1 frontsurfacevertex2distance#=-1 frontsurfacevertex3position#=-1 frontsurfacevertex3height#= -1 frontsurfacevertex3distance#=-1 frontsurfacevertex4position#= 1 frontsurfacevertex4height#= -1 frontsurfacevertex4distance#=-1 frontsurface=CreateSurface(mesh) frontsurfacevertex1=AddVertex(frontsurface,frontsurfacevertex1position,frontsurfacevertex1height,frontsurfacevertex1distance,0,0) frontsurfacevertex2=AddVertex(frontsurface,frontsurfacevertex2position,frontsurfacevertex2height,frontsurfacevertex2distance,1,0) frontsurfacevertex3=AddVertex(frontsurface,frontsurfacevertex3position,frontsurfacevertex3height,frontsurfacevertex3distance,0,1) frontsurfacevertex4=AddVertex(frontsurface,frontsurfacevertex4position,frontsurfacevertex4height,frontsurfacevertex4distance,1,1) AddTriangle frontsurface,frontsurfacevertex1,frontsurfacevertex2,frontsurfacevertex3 AddTriangle frontsurface,frontsurfacevertex2,frontsurfacevertex4,frontsurfacevertex3 ; Bottom bottomsurfacevertex1position#=-1 bottomsurfacevertex1height#= -1 bottomsurfacevertex1distance#= 1 bottomsurfacevertex2position#= 1 bottomsurfacevertex2height#= -1 bottomsurfacevertex2distance#= 1 bottomsurfacevertex3position#=-1 bottomsurfacevertex3height#= -1 bottomsurfacevertex3distance#=-1 bottomsurfacevertex4position#= 1 bottomsurfacevertex4height#= -1 bottomsurfacevertex4distance#=-1 bottomsurface=CreateSurface(mesh) bottomsurfacevertex1=AddVertex(bottomsurface,bottomsurfacevertex1position,bottomsurfacevertex1height,bottomsurfacevertex1distance,0,0) bottomsurfacevertex2=AddVertex(bottomsurface,bottomsurfacevertex2position,bottomsurfacevertex2height,bottomsurfacevertex2distance,1,0) bottomsurfacevertex3=AddVertex(bottomsurface,bottomsurfacevertex3position,bottomsurfacevertex3height,bottomsurfacevertex3distance,0,1) bottomsurfacevertex4=AddVertex(bottomsurface,bottomsurfacevertex4position,bottomsurfacevertex4height,bottomsurfacevertex4distance,1,1) AddTriangle bottomsurface,bottomsurfacevertex1,bottomsurfacevertex2,bottomsurfacevertex3 AddTriangle bottomsurface,bottomsurfacevertex2,bottomsurfacevertex4,bottomsurfacevertex3 ; 1 mesh, 6 sides, all 1 surface. EntityTexture mesh,elementtexture While Not KeyHit(1) If KeyDown(200) TurnEntity mesh, 1, 0, 0 If KeyDown(208) TurnEntity mesh,-1, 0, 0 If KeyDown(203) TurnEntity mesh, 0,-1, 0 If KeyDown(205) TurnEntity mesh, 0, 1, 0 If KeyDown(44) topsurfacevertex2height=topsurfacevertex2height+.05 topsurfacevertex4height=topsurfacevertex4height+.05 frontsurfacevertex2height=frontsurfacevertex2height+.05 backsurfacevertex2height=frontsurfacevertex2height+.05 rightsurfacevertex1height=rightsurfacevertex1height+.05 rightsurfacevertex2height=rightsurfacevertex2height+.05 EndIf If KeyDown(45) topsurfacevertex2height=topsurfacevertex2height-.05 topsurfacevertex4height=topsurfacevertex4height-.05 frontsurfacevertex2height=frontsurfacevertex2height-.05 backsurfacevertex2height=frontsurfacevertex2height-.05 rightsurfacevertex1height=rightsurfacevertex1height-.05 rightsurfacevertex2height=rightsurfacevertex2height-.05 EndIf VertexCoords topsurface,topsurfacevertex2,topsurfacevertex2position,topsurfacevertex2height,topsurfacevertex2distance VertexCoords topsurface,topsurfacevertex4,topsurfacevertex4position,topsurfacevertex4height,topsurfacevertex4distance VertexCoords frontsurface,frontsurfacevertex2,frontsurfacevertex2position,frontsurfacevertex2height,frontsurfacevertex2distance VertexCoords backsurface,backsurfacevertex2,backsurfacevertex2position,backsurfacevertex2height,backsurfacevertex2distance VertexCoords rightsurface,rightsurfacevertex1,rightsurfacevertex1position,rightsurfacevertex1height,rightsurfacevertex1distance VertexCoords rightsurface,rightsurfacevertex2,rightsurfacevertex2position,rightsurfacevertex2height,rightsurfacevertex2distance UpdateWorld RenderWorld Text 0,0,"'Matty's CreateCube style texturing for CreateMesh!' (still working on the name)" Text 0,15,"Controls: directionals, and z and x. Flip Wend End
Okay, here's the thing. I don't actually mind writing tedious code like this believe it or not. I like getting a good coffee buzz on and basically just duplicating everything over and over til it's done. The only thing I'm worried about is, the above code is for just one level element, and my engine will have 32, plus a few more to be used as area change triggers, door openers, etc., all told about 50 elements. Like I said, I don't mind coding all that, but wouldn't all that create some lag? Or is 1200 vertexes 1200 vertexes either way? What I mean is, is there a difference in speed between a level made up of normal meshes totaling 1200, and one made up of highly editable ones like mine totaling 1200? The reason I'm wondering that is not so much because I'm worried about slowdown while editing, but because when an area's done and being played, the vertexes and surfaces would all still have the same long names. I like them to be descriptive since there's so much to keep track of, but would all those names piled up cause problems, or is that nothing to a processor?
Okay, this concludes my embarrassing post for today! :)