Sonic Camera?

Blitz3D Forums/Blitz3D Programming/Sonic Camera?

Caton(Posted April) [#1]
How can I get the camera to turn and follow at some current point?
like this.
https://www.youtube.com/watch?v=L-9UyTsaimc
Thanks.


Flanker(Posted April) [#2]
Not exactly the same effect but there is a nice chasecam in the code archives : https://www.blitzbasic.com/codearcs/codearcs.php?code=2724


Caton(Posted April) [#3]
I tried but it didn't work well.
Texture Here.
https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Checkerboard_pattern.svg/2000px-Checkerboard_pattern.svg.png

Global mode
AppTitle("CameraTest")
Graphics3D 800,600,32,2
SetBuffer BackBuffer()
Global camera=CreateCamera()
PositionEntity camera,0,1,-5
Global player=CreateCube()
Global DISTANCE#=5
light=CreateLight()
plane=CreatePlane()
planetex=LoadTexture("media\Checkerboard.png")
EntityTexture plane,planetex

While Not KeyDown( 1 )
Cls
ControlCamera()
ControlPlayer()
UpdateWorld
RenderWorld
Flip
Wend
End

Function ControlPlayer()
If KeyDown(200) Then TranslateEntity player,0,0,0.1
If KeyDown(208) Then TranslateEntity player,0,0,-0.1
If KeyDown(205) Then TranslateEntity player,0.1,0,0
If KeyDown(203) Then TranslateEntity player,-0.1,0,0
End Function

Function ControlCamera()
If Not (EntityX(player) < DISTANCE#) Then mode=2
If (EntityX(player) < DISTANCE#) Then mode=1
Select mode
Case 1
PointEntity camera,player
Case 2
PositionEntity camera,EntityX(player)-3,EntityY(player)+1,EntityZ(player)-5
End Select
End Function



Flanker(Posted April) [#4]
More like the sonic camera, try this :



Caton(Posted April) [#5]
anyway to change offset when pointing at player when moved to the right or left?


Flanker(Posted April) [#6]
Position the target entity ahead of player.