Camera Animation

Blitz3D Forums/Blitz3D Beginners Area/Camera Animation

Fintan(Posted 2010) [#1]
I am making a first person game and I need to know how to make the camera look around besides the generic movements for walking around. (e.g. falling after death or staggering when poisoned) Is there a simple, yet effective way to "animate" the camera?


Warner(Posted 2010) [#2]
Use a pivot for moving the character around. Attach the camera to the pivot. Turn the camera around using MouseXSpeed and MouseYSpeed.
I believe in the Blitz3DDemo version, there is an example Cubewater, which gives an idea how to make a FPS.


Fintan(Posted 2010) [#3]
I suppose I didn't explain myself as clearly as I could have. I already know how to do what you're saying, Warner. What I want to know how to do are more complex animations like a short cutscene within the game world in the first person.


Yasha(Posted 2010) [#4]
You can animate all entities in the same way, so all you have to do is record the movement sequence you want (by some dark magic - hand-coded, animation application, whatever) and apply it to the camera, or an armature of pivots ending in the camera, just as you would to any mesh that wasn't loaded as an animmesh. If you use B3D Pipeline for 3DS Max, I think it even handles exporting and importing cameras for you (never tried it myself). I think it's fairly normal to handle cutscenes this way.


Fintan(Posted 2010) [#5]
So, how exactly would I go about implementing that? As you can see, I'm fairly new to animation.


jfk EO-11110(Posted 2010) [#6]
It's an interesting quastion, but as far as I remember cameras in 3DS files are not imported by Blitz, but ignored, somebody please verify.

For a cutscene player I would suggest a macro recorder and some special camera motion commands (smoothed, compared to play mode). For a cutscene I would suggest a fixed framerate, allowing to either use a positon and rotation recorder that records every frame, or to record only the user actions and simulate them in the player. Important is the way you can control the camera. Make a list of useful camera movements as seen in movies. Then add some sort of Camera Man controls to the game engine, that you can access with a special code (may be removed from retail version of the game). What you need is a realtime sequencer.

the recorder:

t0=millisecs()
while keyhit(1)=0
if mousehit(1) then 
 myevent(count,0)=1
 myevent(count,1)=millisecs()-t0
 count=count+1
endif
wend

the player:

t0=millisecs()
while playscene
ms=millisecs()-t0
if myevent(c,1)<=ms then
 if myevent(c,0)=1 then simulate mouseclick
 c=c+1
 if c>=count
  c=0
  t0=millisecs()
 endif
endif
wend


you can record all user actions this way, and only a few data is generated.

If you are using a dynamic framerate for the cutscene then it's not so easy with the realtime replay, motions must be interpolated.

Last edited 2010


Kryzon(Posted 2010) [#7]
I would suggest using the Pipeline with Max 9 to make your camera death\hit\whatever animations. Animate a Dummy and then export the B3D with Animations turned on, and "Export Helpers" turned on too.
Within Max you can attach a Free Camera to that Dummy and press C to go to Camera view mode; play the animation and you'll know exactly how the animation will feel in-game (with the view being animated and all).

You'll get a node in that B3D that holds the animation; you can just attach your camera to it - you can also extract all the different sequences into the same mesh so that things are more organized.

PS: This is the same procedure you can use to produce Cutscenes. It gives a whole higher level to your game, having an animated camera.


Fintan(Posted 2010) [#8]
Seeing as 3ds Max is out of my price range at the moment, would I be able to do that in another animation program, say Fragmotion for example? And, if so, how?


Fintan(Posted 2010) [#9]
VICTORY AT LAST!!! I finally found out that the bones are the children of the animmesh, so I was finally able to make the bone a parent to the camera and voila! Thank you all for putting up with my stupidity.


Yasha(Posted 2010) [#10]
3ds Max is out of my price range at the moment


Just in case this is helpful to you: if it happens to be the case that you're a student, 3DSMax and a bunch of other Autodesk applications (including Maya, Mudbox, Motionbuilder etc.) are available for free (registration required, obviously): http://students.autodesk.com/