MapEditor

Blitz3D Forums/Blitz3D Beginners Area/MapEditor

Right now, the way I have the maps loading into my 3D game is it places pre-made cubes depending on where the tiles are on the 2d map. The way I'm wanting it is so that the 3D loader creates its own meshes depending on the location of the tiles.

I was playing around with creating a blitz3d mesh but then I found a problem. Why is it not coloring the vertices like I tell it to?

Graphics3D 800,600,32,2
SeedRnd MilliSecs()

cam = CreateCamera()
PositionEntity cam,-2,1.6,-5
RotateEntity cam,10,-20,0

lig = CreateLight()

pyra=CreateMesh()

surf=CreateSurface(pyra)
	v1=AddVertex(surf,-1,0,1,1,1)
	v2=AddVertex(surf,1,0,1,1,1)
	v3=AddVertex(surf,-1,0,-1,1,1)
	v4=AddVertex(surf,1,0,-1,1,1)
	v5=AddVertex(surf,0,2,0,1,1)

	For v = 1 To CountVertices(surf)
		VertexColor surf,v,0,255,0
	Next
	
t1=AddTriangle(surf,v1,v3,v2)
t2=AddTriangle(surf,v4,v2,v3)
t3=AddTriangle(surf,v3,v5,v4)
t4=AddTriangle(surf,v1,v5,v3)
t5=AddTriangle(surf,v2,v5,v1)
t6=AddTriangle(surf,v4,v5,v2)

UpdateNormals pyra

While Not KeyDown(1)
	
	x#=x+1
	TurnEntity pyra,Cos(x),Sin(x),0
	
	UpdateWorld
	RenderWorld
	
	Text 0,0,Cos(x)
	Text 0,20,Sin(x)
		
	Flip
Wend
End