General Question help with Spacecraft3 animation

dangdongho6

New member
Joined
Oct 27, 2018
Messages
1
Reaction score
0
Points
0
I am currently working on a ship, using Spacecraft3, and I want to animate a gun turret to rotate 85 degrees to the right, then rotate 85 degrees to the left and to continuously perform this operation without having to press the button. The other turrets rotate 360 degrees on a continuous basis until you press the button. Is this possible, and if so, what would the commands be.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
You need to create animation sequences.
Each sequence can have a list of rotations that take place in sequence. ;)
Your keys will activate sequences.

For the actual commands they are on the SC3 manual. I recommend using SC4, since it's the latest version.

Look in the manual for [ANIM_SEQ_0] and [ANIM_COMP_0].
 

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,906
Reaction score
201
Points
138
Location
Cape
Particularly the repeat command.
 

0rbiter X

New member
Joined
Nov 14, 2017
Messages
26
Reaction score
1
Points
3
Hello,
I want to make an animation where an object will rotate 360 ​​° (a gravity wheel). My question is: I need to do the animation in the program "Anim8r" or I only need to make the code lines in files in the folder "spacecraft" ? (or is it something else that I didn't even mention here?)

If someone is going to help, try to be specific please
Thanks!
 

Marg

Active member
Joined
Mar 20, 2008
Messages
483
Reaction score
68
Points
28
code lines in corresponding .ini file.
 

dgatsoulis

ele2png user
Donator
Joined
Dec 2, 2009
Messages
1,924
Reaction score
340
Points
98
Location
Sparta
If you animate it in anim8or (or any other program), Orbiter will have no way of knowing what that animation is. So you need a way to "tell" Orbiter how to create and show your animation.

There are several ways to create and manage animations in Orbiter:

- lua script
- Spacecraft3/4
- VesselBuilder
- C++ module

and probably some others that I am forgetting right now.

The first 2 require editing of text files (.lua and .ini respectively), while vesselbuilder allows you to create vessels and animations while running Orbiter. The C++ option has the advantage of using the full Orbiter API, but you need to setup a development environment and there is a relatively steep learning curve.

Look in (YourOrbiterDirectory)\html\orbiter.chm ->Orbiter Scripting to read and find examples of how to animate with lua.

Read the addon docs\spacecraft.pdf and see the examples and learn how to animate with spacecraft3/4

check out VesselBuilder for Orbiter if you want to use this option.

This forums OrbiterSDK section plus (YourOrbiterDirectory)\Orbitersdk\doc\ for a wealth of information on setting up and developing in C++ for Orbiter.

If someone is going to help, try to be specific please

You'll have to be specific too. In order to create an animation you need the following information:

1.Name of mesh file and its location in your Orbiter installation (i.e: \Meshes\Myship\MySpaceship.msh)
2.Index number of mesh file (0 if it is the only mesh)
3.Type of animation (you've already answered that: "rotation"/repeating)
4. Group(s) index(indices) of the mesh that you want to animate.
5. Reference point in mesh where the rotation axis passes through
6. Rotation axis direction
7. Animation duration in seconds

Post the information above and I (or someone else in the forum) will show you how to create the animation, using one or more of the methods above.
 
Last edited:

jacquesmomo

Addon Developer
Addon Developer
Joined
Jun 14, 2008
Messages
613
Reaction score
453
Points
78
Location
FRANCE
Website
francophone.dansteph.com
Hello,
I want to make an animation where an object will rotate 360 ​​° (a gravity wheel). My question is: I need to do the animation in the program "Anim8r" or I only need to make the code lines in files in the folder "spacecraft" ? (or is it something else that I didn't even mention here?)
If someone is going to help, try to be specific please
Thanks!
I'll try to write an exemple for you this afternoon... With "spacecraft" it is very easy...:tiphat:
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
For reference, search [ANIM_SEQ_0] and [ANIM_COMP_0] on the manual and on example vessels.
For a constantly spinning animation, you need to set the REPEAT parameter.

And please use Spacecraft4...
 

0rbiter X

New member
Joined
Nov 14, 2017
Messages
26
Reaction score
1
Points
3
dgatsoulis, jacquesmomo and my old friend 4throck, thank you all very much.
I thought it would take months for someone come to help. Some information that you 3 have sent will be of great help. If I finish my project I will come back to share with you guys.

---------- Post added at 02:26 AM ---------- Previous post was at 02:10 AM ----------

You'll have to be specific too. In order to create an animation you need the following information:

1.Name of mesh file and its location in your Orbiter installation (i.e: \Meshes\Myship\MySpaceship.msh)
2.Index number of mesh file (0 if it is the only mesh)
3.Type of animation (you've already answered that: "rotation"/repeating)
4. Group(s) index(indices) of the mesh that you want to animate.
5. Reference point in mesh where the rotation axis passes through
6. Rotation axis direction
7. Animation duration in seconds

Post the information above and I (or someone else in the forum) will show you how to create the animation, using one or more of the methods above.

1. FOLDER --- \Meshes\OXISV.msh)
2. Index number of mesh file --- I dont known what exactly what is this. It's just one mesh that I already made.
3. Type of animation ---- "rotation"/repeating
4. Group(s) index(indices) of the mesh that you want to animate --- I dont known what is this either. Only the wheel object (but how does Orbiter knows the difference once when I export my mesh of editor(anim8r) it becomes a unique mix model?)
5. Reference point in mesh where the rotation axis passes through --- Axis X
6. Rotation axis direction --- Axis Z
7. Animation duration in seconds --- have to be slow, I have to test before finish.

Can you make an example txt of the lines of a spacecraft 3/4 file please?
With that and previous help I think already could make my animatios by myself.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
You can start with something like this:

[ANIM_SEQ_0]
; test
KEY=G
DURATION=3

[ANIM_COMP_0]
;test
SEQ=0
GROUPS=0
RANGE=(0.0,1.0)
ROT_PNT=(0,0,0)
ROT_AXIS=(1,0,0)
ANGLE=180.

Should get something rotating around your mesh origin coordinates ;)
 

dgatsoulis

ele2png user
Donator
Joined
Dec 2, 2009
Messages
1,924
Reaction score
340
Points
98
Location
Sparta
2. Index number of mesh file --- I dont known what exactly what is this. It's just one mesh that I already made.
Since you'll be using a single mesh, it doesn't matter; the index is always 0. It would be used if you created a vessel with multiple meshes (ie: a ship with an exterior mesh and a virtual cockpit). This index not used in Vinka's spacecraft4.

4. Group(s) index(indices) of the mesh that you want to animate --- I dont known what is this either. Only the wheel object (but how does Orbiter knows the difference once when I export my mesh of editor(anim8r) it becomes a unique mix model?)
The mesh is a simple text file. At the top it says how many groups your mesh has and if you scroll down you should be able to see the groups. I highly recommend Meshwizard1.9 (look for it in Orbiter Hangar) as it will help you a lot.
5. Reference point in mesh where the rotation axis passes through --- Axis X
The reference point has 3 dimensions, signifying it's distance from the origin.
For example the origin is at 0,0,0 (x,y,z).

7. Animation duration in seconds --- have to be slow, I have to test before finish.

If you are attempting to create an artificial gravity wheel, I recommend this calculator, to find the rpm for a given radius and desired g-force.

Can you make an example txt of the lines of a spacecraft 3/4 file please?
With that and previous help I think already could make my animatios by myself.

Looks like 4throck has that covered in the previous post.
 

CTarana45

Active member
Joined
Nov 7, 2018
Messages
188
Reaction score
41
Points
28
Vinka's Spacecraft Is definately easier than coding your own .DLL files! 80% of my releases use Vinka's.

Thanks, Guys

Christopher Tarana
 

jacquesmomo

Addon Developer
Addon Developer
Joined
Jun 14, 2008
Messages
613
Reaction score
453
Points
78
Location
FRANCE
Website
francophone.dansteph.com
I am currently working on a ship, using Spacecraft3, and I want to animate a gun turret to rotate 85 degrees to the right, then rotate 85 degrees to the left and to continuously perform this operation without having to press the button. The other turrets rotate 360 degrees on a continuous basis until you press the button. Is this possible, and if so, what would the commands be.

@dangdongho6 : I come little late, lot of people have already explained everything to you, but here is another example :

[ANIM_SEQ_0] ; wheel rotation command
KEY= G ; you can define another key here (e.g : K, 1 ,2... etc...)
DURATION=2 ; (time in seconds) increase this value to slow down the rotation, decrease the value to increase the rotation
REPEAT=1 ; read the spacedraft4 doc : repeat mode : ; (0=no repeat (default) ;1=repeat by restarting cycle (0->1;0->1;0->…) ; 2=repeat by reversing cycle (0->1->0->1->0->…)


[ANIM_COMP_0] ; wheel rotation animation
SEQ=0 (same numero as "anim_seq_n)
GROUPS=3 ; group order number in your *.msh file
RANGE=(0,1) ; animation starts at begining (0) and finish at the end (1) if : (0,0.5) ends in the middle (not good for this example)
ROT_PNT=(0,0,0) ; coordinates of the rotation point (you have to look for the right coordinates)
ROT_AXIS=(1,0,0) ; x,y,z axes - here axis is "X" - you have to look for the right axis (if not orthogonal attention the axis-vector must be normalized : ex : (0.7453,0.2981,0.5962)
ANGLE=360 ; for rotate like a wheel (car, orbital station) this value must be 360 ° or a multiple (720 etc)
;PARENT= ; no use here (but if your wheel is attached to a moving element, it is useful, but needless to complicate things here ...) :lol:

If you have other questions, don't hesitate ... :tiphat:
:cheers:
 
Last edited:

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,906
Reaction score
201
Points
138
Location
Cape
Just to add a couple of things.

You need to press Lshft+ "key" for the operation. Also, Spacecraft3 only allows you to use the numpad keys for animation, not the regular number 1-0.

Another way to find your way around, it use an existing .ini file and change stuff and see what happens. :yes:
 

CTarana45

Active member
Joined
Nov 7, 2018
Messages
188
Reaction score
41
Points
28
Doesn't using a material named TH_Color cause 3ds2mesh to write a text file with the Coordinates?

Thanks, Guys!

Christopher Tarana
 

jacquesmomo

Addon Developer
Addon Developer
Joined
Jun 14, 2008
Messages
613
Reaction score
453
Points
78
Location
FRANCE
Website
francophone.dansteph.com
Just to add a couple of things.
You need to press Lshft+ "key" for the operation. Also, Spacecraft3 only allows you to use the numpad keys for animation, not the regular number 1-0.
Exact ! But with Spacecraft4 (not 3) you can also use the keyboard number keys on the top (But also whith left-Shift + 0 to 9)

Just to add a couple of things.
Another way to find your way around, it use an existing .ini file and change stuff and see what happens. :yes:
Right. It's the best way to learn. :tiphat:
 
Top