SDK Question how does orbiter animation work?

kniqht152

New member
Joined
Sep 6, 2008
Messages
4
Reaction score
0
Points
0
Hi guys!,

Firstly I'd like say hello to all you fabulous folks, This my first post and I'm pretty excited, I'd also like to say THANK YOU to dan steph, tex, martin, and doug beachy, Im sure there are people I've missed but serously you guys and your addons are the only reason I've been playin orbiter for this long (yearish). Anyway this whole UCGO thing has got me in addon fever and I've started to create my first addon for orbiter. However I've run across a snag, I've created a simple model and mesh then managed to successfully import it and fly it in orbiter (i've also made a very basic dll for it). My only question is how does animation (like gear and airfoils) work in orbiter. I'm under the impression that I must create my model with all of its doors/bays open and deployed and that there are funtions I can use in my dll file to rotate/scale/move different parts of the ship to create the illusion of animation. If somebody could explain it to me or point in the right direction I'd really appreciate it.


Thanks a ton!
:cheers:
 
You could animate it with the using of spacecraft3.dll based vessel. This allows via ini files to animate groups. http://users.swing.be/vinka/
Or you could code a custom dll based vessel.
 
Thanks for the quick response I appreciate it, but I guess I should clarify my situation a bit more. I'm dead set on making a custom dll and using that for my spacecraft. In fact I already have a simple one set up. I guess my only real trouble is where can I find more information on the orbiter API specifically the animation portion?
 
Aside of the Orbiter API Reference, you should know how affine transformations in mathematics work: Rotations, Translations, Scaling. The behavior of Orbiter is exactly like in the mathematical theory.

The rest is pretty simple. Parent animations are also applied to child animations, so you don't need to repeat the child groups in the parent animation.

In C++ remember that the data for groups, animation components etc have to remain valid in memory until you finished using it. Local data definitions are exactly what you don't want, so consider this in your constant definition, make constants "static" or use dynamic memory allocation and object variables.
 
That's exactly what I need to know, thank you, and Merry Christmas!
 
For details about how to define animations from code, take a look at section 1.10 Defining an animation sequence in Orbitersdk\doc\API_Guide.pdf.

If you want to look at some sample code, take a look in OrbiterSDK\samples\DeltaGlider\DeltaGlider.cpp at the following methods:

DefineAnimations () [ties mesh groups to animation components and defines how each mesh group should move]

clbkPostStep (double simt, double simdt, double mjd) [actually animates the mesh groups by setting the state of each animation component; invoked at each time step]
 
Better yet, look at the HST sample code. It is written to serve as a tutorial for animations.
 
HST sample code? Whats HST?

---------- Post added at 03:34 PM ---------- Previous post was at 03:29 PM ----------

Never mind that question I just found it in the orbitersdk samples directory :)
I guess its time to put my copy and paste skills to good use.
 
Back
Top