Here is the code, but i will try the update normals:
AppTitle "PC Battles 3D"
Graphics3D 640,480,16,0
SetBuffer(BackBuffer())
;values needed for debug info
Global Frame_Rate,Frame,My_Clock = MilliSecs()
Camera = CreateCamera()
Light = CreateLight(1,Camera)
CameraRange Camera,1,1000
PositionEntity Camera,-5,10,-5
RotateEntity Camera,60,0,0
Global Grass = LoadTexture("Textures\grass.bmp",256)
;ScaleTexture Grass,3,3
Global Beach = LoadTexture("Textures\beach.bmp",256)
;ScaleTexture Beach,3,3
Global Sea = LoadTexture("Textures\Sea.bmp",256)
;ScaleTexture Sea,3,3
Global Road_Straight_Horizontal = LoadTexture("Textures\Horizontal_Straight.bmp",256)
Global Road_Straight_Vertical = LoadTexture("Textures\vert_straight.bmp",256)
Global Bottom_Left_Corner = LoadTexture("Textures\Bottom Left Corner.bmp",256)
Global Bottom_Right_Corner = LoadTexture("Textures\Bottom Right Corner.bmp",256)
Global Top_Left_Corner = LoadTexture("Textures\Top Left Corner.bmp",256)
Global Top_Right_Corner = LoadTexture("Textures\Top Right Corner.bmp",256)
Global Mesh = Render_Use_Mesh()
PositionEntity mesh,0,2,0
While Not KeyHit (1)
Cls
TurnEntity Mesh,0,1,0
update_camera(camera)
UpdateWorld()
RenderWorld()
Display_Debug_Info()
Flip
Wend
Function Display_Debug_Info()
Locate 40,390
Print "Triangles Rendered: " + TrisRendered()
Locate 40,410
Print "Frame Rate : " + Frame_Rate
Frame= Frame +1
If MilliSecs() >= My_clock +1000 Then
My_Clock = MilliSecs()
Frame_Rate = Frame
Frame = 0
End If
Locate 40,430
Print "Vid Mem: " + AvailVidMem()
Locate 40,450
Print "Vid Mem Total: " + TotalVidMem()
End Function
;---------------------------------------------------------------------------------
Function Load_Map(LevelNumber$)
End Function
Function Render_Use_Mesh()
Mesh = CreateMesh()
Surface = CreateSurface(mesh)
v0 = AddVertex(Surface,0,0,0)
v1 = AddVertex(Surface,0,0,1)
v2 = AddVertex(Surface,4,0,1)
v3 = AddVertex(Surface,4,0,0)
v4 = AddVertex(Surface,0,2,0)
v5 = AddVertex(Surface,0,2,1)
t0 = AddTriangle(Surface,v0,v3,v2)
t1 = AddTriangle(Surface,v0,v2,v1)
t2 = AddTriangle(Surface,v0,v4,v3)
t3 = AddTriangle(Surface,v1,v2,v5)
t4 = AddTriangle(Surface,v0,v1,v5)
t5 = AddTriangle(Surface,v0,v5,v4)
t6 = AddTriangle(Surface,v2,v4,v5)
t7 = AddTriangle(Surface,v2,v3,v4)
Return mesh
End Function
;---------------------------------------------------------------------------------
Function Update_Camera(Which_Camera)
If KeyDown(203) Then ;left
TurnEntity Which_Camera,0,1,0
End If
If KeyDown(205) Then ;right
TurnEntity Which_Camera,0,-1,0
End If
If KeyDown(200) Then ;up
TurnEntity Which_Camera,1,0,0
End If
If KeyDown(208) Then ;down
TurnEntity Which_Camera,-1,0,0
End If
If KeyDown(17) Then ;w
MoveEntity Which_Camera,0,0,.5
End If
If KeyDown(31) Then ; s
MoveEntity Which_camera,0,0,-.5
End If
End Function
Also, if wireframe doesn;t work, can i texture it with the normal textureentity,or do i have to use brushs (only just learning this stuff ook, so expect a few stupid questions )
[EDIT] Ok, got it working, looks like i needed to update the normals of the mesh before it would work, now the fun part, playing around with the code :)
AppTitle "PC Battles 3D"
Graphics3D 640,480,16,0
SetBuffer(BackBuffer())
;values needed for debug info
Global Frame_Rate,Frame,My_Clock = MilliSecs()
Camera = CreateCamera()
Light = CreateLight(1,Camera)
CameraRange Camera,1,1000
PositionEntity Camera,-5,10,-5
RotateEntity Camera,60,0,0
Global Grass = LoadTexture("Textures\grass.bmp",256)
;ScaleTexture Grass,3,3
Global Beach = LoadTexture("Textures\beach.bmp",256)
;ScaleTexture Beach,3,3
Global Sea = LoadTexture("Textures\Sea.bmp",256)
;ScaleTexture Sea,3,3
Global Road_Straight_Horizontal = LoadTexture("Textures\Horizontal_Straight.bmp",256)
Global Road_Straight_Vertical = LoadTexture("Textures\vert_straight.bmp",256)
Global Bottom_Left_Corner = LoadTexture("Textures\Bottom Left Corner.bmp",256)
Global Bottom_Right_Corner = LoadTexture("Textures\Bottom Right Corner.bmp",256)
Global Top_Left_Corner = LoadTexture("Textures\Top Left Corner.bmp",256)
Global Top_Right_Corner = LoadTexture("Textures\Top Right Corner.bmp",256)
Global Mesh = Render_Use_Mesh()
PositionEntity mesh,0,2,0
While Not KeyHit (1)
Cls
TurnEntity Mesh,0,1,0
update_camera(camera)
UpdateWorld()
RenderWorld()
Display_Debug_Info()
Flip
Wend
Function Display_Debug_Info()
Locate 40,390
Print "Triangles Rendered: " + TrisRendered()
Locate 40,410
Print "Frame Rate : " + Frame_Rate
Frame= Frame +1
If MilliSecs() >= My_clock +1000 Then
My_Clock = MilliSecs()
Frame_Rate = Frame
Frame = 0
End If
Locate 40,430
Print "Vid Mem: " + AvailVidMem()
Locate 40,450
Print "Vid Mem Total: " + TotalVidMem()
End Function
;---------------------------------------------------------------------------------
Function Load_Map(LevelNumber$)
End Function
Function Render_Use_Mesh()
Mesh = CreateMesh()
Surface = CreateSurface(mesh)
v0 = AddVertex(Surface,0,0,0)
v1 = AddVertex(Surface,0,0,1)
v2 = AddVertex(Surface,4,0,1)
v3 = AddVertex(Surface,4,0,0)
v4 = AddVertex(Surface,0,2,0)
v5 = AddVertex(Surface,0,2,1)
t0 = AddTriangle(Surface,v0,v3,v2)
t1 = AddTriangle(Surface,v0,v2,v1)
t2 = AddTriangle(Surface,v0,v4,v3)
t3 = AddTriangle(Surface,v1,v2,v5)
t4 = AddTriangle(Surface,v0,v1,v5)
t5 = AddTriangle(Surface,v0,v5,v4)
t6 = AddTriangle(Surface,v2,v4,v5)
t7 = AddTriangle(Surface,v2,v3,v4)
Return mesh
End Function
;---------------------------------------------------------------------------------
Function Update_Camera(Which_Camera)
If KeyDown(203) Then ;left
TurnEntity Which_Camera,0,1,0
End If
If KeyDown(205) Then ;right
TurnEntity Which_Camera,0,-1,0
End If
If KeyDown(200) Then ;up
TurnEntity Which_Camera,1,0,0
End If
If KeyDown(208) Then ;down
TurnEntity Which_Camera,-1,0,0
End If
If KeyDown(17) Then ;w
MoveEntity Which_Camera,0,0,.5
End If
If KeyDown(31) Then ; s
MoveEntity Which_camera,0,0,-.5
End If
End Function
Also, if wireframe doesn;t work, can i texture it with the normal textureentity,or do i have to use brushs (only just learning this stuff ook, so expect a few stupid questions )
[EDIT] Ok, got it working, looks like i needed to update the normals of the mesh before it would work, now the fun part, playing around with the code :)