How to control the camera?

Blitz3D Forums/Blitz3D Beginners Area/How to control the camera?

Guan(Posted 2005) [#1]
Hi, I'm a newbie here:) How can I control the camera, for example, I want to set the eye at (10,2,3), and look at the point (20,3,20)?


Sledge(Posted 2005) [#2]
;PRESS SPACE TO SEE CAMERA TRACK MOVING TARGET
Graphics3D 640,480,0,2
SetBuffer BackBuffer()

cam=CreateCamera()
PositionEntity cam,10,2,3

target=CreatePivot()
PositionEntity target,20,3,20

model=CreateCube(target)
EntityFX model,1
reference=CreateCube()
ScaleEntity reference,5,.1,5
PositionEntity reference,20,1,20 

base=90

While Not KeyDown(1)

If KeyDown(57)
base=base+1 : If base>360 Then base=base-360
PositionEntity target,20+(Cos(base)*1.5),3,20
EndIf


PointEntity cam,target
UpdateWorld
RenderWorld
Flip
 
Wend



Guan(Posted 2005) [#3]
Got it, thank you very much:)