Wont work
Graphics3D 800,600,16,0
SetBuffer BackBuffer()
;*----------------------
;| OPTION |
;-----------------------
mapw=800
maph=800
Const tile=10
Dim map(mapw,maph,2) ;0 pour vertex, 1 pour z, 2
;-------------------------<
p=CreatePivot()
cam=CreateCamera(p)
PositionEntity p,0,0,0
l=CreateLight(2)
PositionEntity l,0,0,-200
ground=CreateMesh()
surf=CreateSurface(ground)
TurnEntity ground,-180,0,0
PositionEntity ground,0,200,10
For gx=1 To mapw Step tile
For gy=1 To maph Step tile
map(gx,gy,1)=Rand(20)
map(gx,gy,0)=AddVertex(surf,gx,gy,map(gx,gy,1))
Next
Next
For gx=1 To mapw-tile Step tile
For gy=1 To maph-tile Step tile
AddTriangle(surf,map(gx,gy,0),map(gx+tile,gy,0),map(gx+tile,gy+tile,0))
AddTriangle(surf,map(gx,gy+tile,0),map(gx,gy,0),map(gx+tile,gy+tile,0))
Next
Next
tex=LoadTexture ("texture/bison.bmp")
Print tex
EntityTexture ground,tex
Rect 0,50,256,20
SetBuffer BackBuffer()
While Not KeyHit(1)
TurnEntity l,0,1,0
fps=MilliSecs()
If KeyDown(200) Or MouseDown(3) Then
MoveEntity p,0,2,0
ElseIf KeyDown(208) Then
MoveEntity p,0,-2,0
EndIf
If KeyDown(205) Then
MoveEntity p,2,0,0
ElseIf KeyDown(203) Then
MoveEntity p,-2,0,0
EndIf
If KeyDown(77) Or MouseDown(3) Then
MoveEntity p,0,0,2
ElseIf KeyDown(81) Then
MoveEntity p,0,0,-2
EndIf
mx=mx+MouseXSpeed()
my=my+MouseYSpeed()
RotateEntity p,0,0,-mx
RotateEntity cam,my,0,0
RenderWorld
Text 0,0,"Fps: "+(MilliSecs()-fps)
MoveMouse 400,300
Flip
Wend
Also i'd like to know how to texture triangle/triangle if it's possible.
Where must i put UPDATENORMALS mesh?
Thanks anyway...
Graphics3D 800,600,16,0
SetBuffer BackBuffer()
;*----------------------
;| OPTION |
;-----------------------
mapw=800
maph=800
Const tile=10
Dim map(mapw,maph,2) ;0 pour vertex, 1 pour z, 2
;-------------------------<
p=CreatePivot()
cam=CreateCamera(p)
PositionEntity p,0,0,0
l=CreateLight(2)
PositionEntity l,0,0,-200
ground=CreateMesh()
surf=CreateSurface(ground)
TurnEntity ground,-180,0,0
PositionEntity ground,0,200,10
For gx=1 To mapw Step tile
For gy=1 To maph Step tile
map(gx,gy,1)=Rand(20)
map(gx,gy,0)=AddVertex(surf,gx,gy,map(gx,gy,1))
Next
Next
For gx=1 To mapw-tile Step tile
For gy=1 To maph-tile Step tile
AddTriangle(surf,map(gx,gy,0),map(gx+tile,gy,0),map(gx+tile,gy+tile,0))
AddTriangle(surf,map(gx,gy+tile,0),map(gx,gy,0),map(gx+tile,gy+tile,0))
Next
Next
tex=LoadTexture ("texture/bison.bmp")
Print tex
EntityTexture ground,tex
Rect 0,50,256,20
SetBuffer BackBuffer()
While Not KeyHit(1)
TurnEntity l,0,1,0
fps=MilliSecs()
If KeyDown(200) Or MouseDown(3) Then
MoveEntity p,0,2,0
ElseIf KeyDown(208) Then
MoveEntity p,0,-2,0
EndIf
If KeyDown(205) Then
MoveEntity p,2,0,0
ElseIf KeyDown(203) Then
MoveEntity p,-2,0,0
EndIf
If KeyDown(77) Or MouseDown(3) Then
MoveEntity p,0,0,2
ElseIf KeyDown(81) Then
MoveEntity p,0,0,-2
EndIf
mx=mx+MouseXSpeed()
my=my+MouseYSpeed()
RotateEntity p,0,0,-mx
RotateEntity cam,my,0,0
RenderWorld
Text 0,0,"Fps: "+(MilliSecs()-fps)
MoveMouse 400,300
Flip
Wend
Also i'd like to know how to texture triangle/triangle if it's possible.
Where must i put UPDATENORMALS mesh?
Thanks anyway...