Question Modelling the rocket

Phil Smith

Donator
Donator
Joined
Jun 5, 2011
Messages
268
Reaction score
97
Points
43
Location
UK
hey guys.
i've got the model of rocket with textures in 3d max so i wanna to put it into ORBITER. i'm rookie in that game modelling but i got big experience in 3d addons for another games (ex. for GTA)
this is one-staged rocket with payload at the top.
the stage has one single-chamber engine.
mini version of the flight program - liftoff, after 120 sec of flight engine cutoff, 1st stage separation, 1st stage solid retro engines fired, payload falls on ballistic trajectory, payload chutes open.
also all parameters of engine, all masses etc are known.
so please help me out i strongly need this model in orbiter:hailprobe:
 

MaverickSawyer

Acolyte of the Probe
Joined
Apr 11, 2011
Messages
3,919
Reaction score
5
Points
61
Location
Wichita
First step: read the Spacecraft 3 Tutorials. If you can make it work with that, go for it! If not, learn C++. There's an awesome community of coders here to help you.
Have fun!
 

Tommy

Well-known member
Joined
Aug 14, 2008
Messages
2,019
Reaction score
86
Points
48
Location
Here and now
Also, check the documentation that resides in the Orbiter/OrbiterSDK folder. One of those docs contains a lot of info on modeling for Orbiter.
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,271
Reaction score
3,244
Points
203
Location
Toulouse
If you can make it work with that, go for it! If not, learn C++

Learn C++. You won't regret it. ;)

In order to use the mesh in Orbiter, you need to convert it from .3ds to .msh . There is a program "Meshwizard" that can do that (see on Orbithangar).

My best hint for a first addon would be to use only a .cfg file (look in the \config folder for exemples and read the Orbiter doc). This way you can already play with things.

For payload separation, parachutes etc... C++ will bring you all the freedom you need to express your creativity.

Good luck ! :cheers:
 

Phil Smith

Donator
Donator
Joined
Jun 5, 2011
Messages
268
Reaction score
97
Points
43
Location
UK
oh thanks!
i read this tutorials and try to put my model into the game with spacescraft3.dll for a first time, but i got some skills in c++ coding so i guess it wont be quite difficult for me. so it's time to ask is anywhere some kinda tutorial exactly in c++ codin for orbiter?
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,271
Reaction score
3,244
Points
203
Location
Toulouse
Absolute must see :


You can then look at the exemples in the sdk\samples directory, or look the other video tutorials of the same author.

Also you have a help file in the SDK\doc directory that lists the functions & commands included in the Orbiter libraries.
 

Phil Smith

Donator
Donator
Joined
Jun 5, 2011
Messages
268
Reaction score
97
Points
43
Location
UK
oh tnx man, great video! now im tryin to learn this stuff with SDK manuals. so im gonna put the progress of my mod here and ask help for sure if you please, cause for me it's kinda new
 

Izack

Non sequitur
Addon Developer
Joined
Feb 4, 2010
Messages
6,665
Reaction score
13
Points
113
Location
The Wilderness, N.B.
oh tnx man, great video! now im tryin to learn this stuff with SDK manuals. so im gonna put the progress of my mod here and ask help for sure if you please, cause for me it's kinda new
It probably won't work out that way. Follow the SDK docs, but it's more important that you look at general tutorials for the language; the documentation assumes the reader has some knowledge of programming. :)
 

Phil Smith

Donator
Donator
Joined
Jun 5, 2011
Messages
268
Reaction score
97
Points
43
Location
UK
so first off I say parameters of the rocket.
One stage rocket with payload on top. it looks like mercury-redstone rocket with its shape.

Total rocket height - 4m
Stage dia - 0.5 m

MAIN ENGINE
Propellant - Rp-1/H2O2;
Mixture ratio - 8/1 (O/F);
Burning time - 100 sec;
Total mass flow - 4.43 kg/sec;
Chamber pressure - 7 MPa;
Spec impulse (at SL) - 242 sec;
Spec impulse (in void) - 277 sec;
Thrust (at SL) - 10,314 N;
Thrust (in void) - 11,800 N;
Nozzle exit dia - 140 mm;
Ae/At = 16.

MASSES
First stage (empty) - 150 kg;
First stage propellant - 443 kg;
Payload mass - 50 kg.

so now i'm tryin to write simple flight - just liffoff, burnin 100 sec until fuel ends and sep.
but it's quite difficult to me for the first time.
after that i plan modelling all small solid retro engines and chutes for payload capsule
and also we have no pitching and roll programs at all - it just flies vertically at 90 degree.
 
Last edited:

Phil Smith

Donator
Donator
Joined
Jun 5, 2011
Messages
268
Reaction score
97
Points
43
Location
UK
ive read material at SDK and write some code for me vehicle.
we have "libra_1.msh", "libra_1.dds" and "libra_1.scn" so can anybody help me and complete this code for launching that one.
for the first time w/o separetion of payload and chutes
i appreciate any kinda help very much!

Code:
#define ORBITER_MODULE
#include "orbitersdk.h"
#include "math.h"

HINSTANCE g_hDLL;

class Libra_1: public VESSEL
	{
		PROPELLANT_HANDLE ph_main;
		THRUSTER_HANDLE th_main;
	}

void Libra_1::clbkSetClassCaps (FILEHANDLE cfg) 
	{ 
		SetEmptyMass (150.0); 
		SetSize (3.75); 
		AddMesh (oapiLoadMeshGlobal (“Libra_1.msh”)); 
		const double MAX_MAIN_FUEL = 443;
		ph_main = CreatePropellantResource (MAX_MAIN_FUEL);
		const double MAX_MAIN_THRUST = 11800;
		const double VAC_MAIN_ISP = 2710.5;
		const double NML_MAIN_ISP = 2345.2;
		const double P_NML = 101.4e3;
		th_main = CreateThruster (_V(0,0,-1.675), _V(0,0,1), MAX_MAIN_THRUST, ph_main, VAC_MAIN_ISP, NML_MAIN_ISP, P_NML);
		SURFHANDLE tex = oapiRegisterExhaustTexture (“Exhaust_atsrb”);
		AddExhaust (th_main, 10, 2, tex);
		SURFHANDLE tex = oapiRegisterReentryTexture (“Reentry”);
		SetReentryTexture (tex, my_plimit, my_lscale, my_wscale);
	}
 
Last edited:

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,271
Reaction score
3,244
Points
203
Location
Toulouse
I'm not an expert, but does that help ?

Code:
#define STRICT
#define ORBITER_MODULE

#include "orbitersdk.h"
#include "math.h"

class Libra_1: public VESSEL3 {
public:
	Libra_1 (OBJHANDLE hVessel, int flightmodel);
	~Libra_1 ();
	void clbkSetClassCaps (FILEHANDLE cfg);

	PROPELLANT_HANDLE ph_main;
	THRUSTER_HANDLE th_main;

private:

        const double MAX_MAIN_FUEL = 443;
	const double MAX_MAIN_THRUST = 11800;
	const double VAC_MAIN_ISP = 2710.5;
	const double NML_MAIN_ISP = 2345.2;
	const double P_NML = 101.4e3;

};

Libra_1::Libra_1 (OBJHANDLE hVessel, int flightmodel)
: VESSEL3 (hVessel, flightmodel)
{
}

Libra_1::~Libra_1 ()
{
}

void Libra_1::clbkSetClassCaps (FILEHANDLE cfg) 
{ 
	SetEmptyMass (150.0); 
	SetSize (3.75); 
	AddMesh (oapiLoadMeshGlobal (“Libra_1.msh”)); 

	ph_main = CreatePropellantResource (MAX_MAIN_FUEL);

	th_main = CreateThruster (_V(0,0,-1.675), _V(0,0,1), MAX_MAIN_THRUST, ph_main, VAC_MAIN_ISP, NML_MAIN_ISP, P_NML);

	SURFHANDLE tex = oapiRegisterExhaustTexture (“Exhaust_atsrb”);

	AddExhaust (th_main, 10, tex);
}

DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel)
{
	return new Libra_1 (hvessel, flightmodel);
}

DLLCLBK void ovcExit (VESSEL *vessel)
{
	if (vessel) delete (Libra_1*)vessel;
}
 
Last edited:

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,271
Reaction score
3,244
Points
203
Location
Toulouse
There was an error here, forgot a scale parameter, fixed :

Code:
AddExhaust (th_main, 10, 2, tex);
 
Top