Hi I need to ask a question?

Blitz3D Forums/Blitz3D Beginners Area/Hi I need to ask a question?

unixos(Posted 2015) [#1]
Hello, I have a model I made and I was wandering what would be the best way to make a cam movie forward to the end of my model and keeps doing that until the user clicks on next, I have all that done just do not know away to make the cam move by its self. Thanks


Matty(Posted 2015) [#2]
Update the position of the camera each frame along it's local z-axis?


RemiD(Posted 2015) [#3]
What i would do :
Turn move the entity as you want.
Get the position orientation of the entity with EntityX(), EntityY(), EntityZ(), EntityPitch(), EntityYaw(), EntityRoll().
Then position rotate your camera at the same position orientation than the entity with PositionEntity() RotateEntity().
Then Turn Move the camera as you want so that it is positioned as you want (behind the character/vehicle) and look where you want (at the character/vehicle), you could also use PointEntity.


_PJ_(Posted 2015) [#4]
Graphics3D 800,600,32
SetBuffer BackBuffer()

Local Mesh=LoadMesh("mymesh.x")
Local Length#=MeshDepth(Mesh)*0.5
Local Height#=MeshHeight(Mesh)*0.5

Local Duration#=10000;  10 seconds
Local Ratio#=(Length*2)/Duration

Local Cam=CreateCamera()

PositionEntity Mesh, 0,0-Height,Lenth
PositionEntity Camera,0,(Height)+1,0

Local Timestamp=Millisecs()
Local Time

While (Time<Duration)
PositionEntity Cam,0,(Height)+1,Time*Ratio#
RenderWorld
Flip
Time=Millisecs()-Timestamp
Wend
ClearWorld
EndGraphics
End



Matty(Posted 2015) [#5]
In an old 3d animation tool I used to use what they did was have a pivot for the camera, a pivot for the camera 'look at position' and move them independently. In such a case point entity and position entity would be all that you need. In fact I use something very similar in my own game.


RemiD(Posted 2015) [#6]
An old ugly code to demonstrate what i mean :
http://www.blitzbasic.com/codearcs/codearcs.php?code=2933
(press tab to change the view)