Project Updated SLS for Orbiter 2016 (and 2010)

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Discovering normal mapping in d3d9. Great tool for more detail.

That's the right solution. No performance hit and great effect.

Geometric detail only becomes really important for shadows and realtime occlusion.

You should also take a look into specular/reflection maps, d3d9 supports those and they make a difference for some materials.
 

Longjap

Active member
Joined
Jun 8, 2011
Messages
191
Reaction score
41
Points
28
That's the right solution. No performance hit and great effect.

Geometric detail only becomes really important for shadows and realtime occlusion.

You should also take a look into specular/reflection maps, d3d9 supports those and they make a difference for some materials.

Specular, that's something I didn't understand yet. The documentation only explains how to save the file IIRC. I'm not sure what it does. For the normals I basically looked at other add-ons and how they did it.

There are some irregularities though between 2016 and 2010. Some normals are reversed between the two. Not sure how to solve it yet.

---------- Post added at 01:59 AM ---------- Previous post was at 01:44 AM ----------

Mr. Longjap, have you taken over the SLS project? I have not been present recently.

Hi sir Astro SG Wise,

I didn't have the intention to take over anything really. After 2016 came out I went back at the game again and wished to have the new Orange SLS to shoot to the stars.

At that point I couldn't find any or the projects were quiet and with the help of Multistage2015 of Fred it dawned to me I could make my own quite "easily". So basically I made some pretty accurate meshes and textures for the new SLS.

But yeah, it seems the SLS focus has drawn to this place I guess. Any help is appreciated. I'm here for the visuals mostly. :)
 

Loopos

Procrastination Master
Joined
Sep 17, 2016
Messages
38
Reaction score
9
Points
8
May 20th, 2020, a beautiful day to launch a SLS Block IB but where is the EUS?
 

Longjap

Active member
Joined
Jun 8, 2011
Messages
191
Reaction score
41
Points
28
May 20th, 2020, a beautiful day to launch a SLS Block IB but where is the EUS?

Hi AeronaticalPerson,

Which version of orbiter do you run? And do you have D3D9 installed? It might be because I didn't compress the texture. I'll have a look.
 

Loopos

Procrastination Master
Joined
Sep 17, 2016
Messages
38
Reaction score
9
Points
8
Originally Posted by Lonjap
"Hi AeronaticalPerson,

Which version of orbiter do you run? And do you have D3D9 installed? It might be because I didn't compress the texture. I'll have a look."
Thx but the D3D9 isn't doing anything...
And my Orbiter Version is v.160828 (O2016)
 
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
Ok. I got the crawler animation to work. You can steer, lift and raise the body. But NOT at the same time.
ypQubB1.jpg


Next I will work on the tower. I might add if attach then set new touchdown points. So you get the tower and move to the launchpad. Then place it where you want. dettach from the crawler and she stand on the feet.

Too align the tower on the feet. It is visually.

This is all in 2010. For some reason I put the crawler in 2016 it spins violently.
 

barrygolden

Well-known member
Joined
Nov 3, 2009
Messages
949
Reaction score
298
Points
78
Location
North of Houston
Hey Guys there is still a lot of us that use 2010 so please do a detailed SLS for us.

I did see that the new administration offered to let Boeing or Space X build the production models of Orion and Lockheed came back and said they could cut the price in 1/2 to build them. Thats why we are stuck on the ground today, overcharging.

I also see a plan to fly one SLS flight a year and two or three CCT flights to the ISS per year, and a new Moon program looms on the horizon along with the Gateway Station in mid 2020's
 

Longjap

Active member
Joined
Jun 8, 2011
Messages
191
Reaction score
41
Points
28
Hey Guys there is still a lot of us that use 2010 so please do a detailed SLS for us.

I did see that the new administration offered to let Boeing or Space X build the production models of Orion and Lockheed came back and said they could cut the price in 1/2 to build them. Thats why we are stuck on the ground today, overcharging.

I also see a plan to fly one SLS flight a year and two or three CCT flights to the ISS per year, and a new Moon program looms on the horizon along with the Gateway Station in mid 2020's

Hi Barrygolden,

We plan to release it for both 2010 and 2016. You can try the Beta if you want for 2010, the download is at the first post.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
So I got my SLScrawler to run good in 2010. So in 2016. I am trying to use Fred18's crawler code to move. But when I move it throws me in space :(
As I see it we need 2 things. 1 crawler to move. 2 determine the distance from the landing pad. This will allow touchdown points to be changed for hill climbing.
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
So I got my SLScrawler to run good in 2010. So in 2016. I am trying to use Fred18's crawler code to move. But when I move it throws me in space :(
As I see it we need 2 things. 1 crawler to move. 2 determine the distance from the landing pad. This will allow touchdown points to be changed for hill climbing.

I just learned how to code the upright creation without using the hack of ms2015 crawler (I'll update that in the next update).

1st: to avoid being flung into space you have to proper set your touchdown points, I already gave in that topic the code which anyway is:

Code:
double EmptyMass=1000;
SetEmptyMass(EmptyMass);
double ro=30;
TOUCHDOWNVTX td[4];
double x_target=-0.5;
double stiffness=(-1)*(EmptyMass*9.80655)/(3*x_target);
double damping=0.9*(2*sqrt(EmptyMass*stiffness));
 for(int i=0;i<4;i++)
 {
	
	 td[i].damping=damping;
	 td[i].mu=3;
	 td[i].mu_lng=3;
	 td[i].stiffness=stiffness;
 }
 td[0].pos.x=-cos(30*RAD)*ro;
 td[0].pos.y=-sin(30*RAD)*ro;
 td[0].pos.z=-0.50;
 td[1].pos.x=0;
 td[1].pos.y=1*ro;
 td[1].pos.z=-0.50;
 td[2].pos.x=cos(30*RAD)*ro;
 td[2].pos.y=-sin(30*RAD)*ro;
 td[2].pos.z=-0.50;
 td[3].pos.x=0;
 td[3].pos.y=0;
 td[3].pos.z=15*ro;

while the creation code will be the following, note that if modified it can easily be used to move it around, just take the values of the ms2015 crawler:
Code:
MATRIX3 SpaceNetwork2016::RotationMatrix(VECTOR3 angles,bool xyz)
 {
	MATRIX3 m;
 	MATRIX3 RM_X,RM_Y,RM_Z;
	RM_X=_M(1,0,0,0,cos(angles.x),-sin(angles.x),0,sin(angles.x),cos(angles.x));
	RM_Y=_M(cos(angles.y),0,sin(angles.y),0,1,0,-sin(angles.y),0,cos(angles.y));
	RM_Z=_M(cos(angles.z),-sin(angles.z),0,sin(angles.z),cos(angles.z),0,0,0,1);
	if(!xyz)
	{
	m=mul(RM_Z,mul(RM_Y,RM_X));
	}else{
	m=mul(RM_X,mul(RM_Y,RM_Z));
	}
 return m;
 }

////CREATION CODE! with Long Lat and Heading your targets
VESSELSTATUS2 vs;
memset(&vs,0,sizeof(vs));
vs.version=2;
OBJHANDLE hearth=oapiGetObjectByName("Earth");
vs.rbody=hearth;
vs.status=1;
vs.surf_lng=Long*RAD;
vs.surf_lat=Lat*RAD;
vs.surf_hdg=Heading*RAD;
MATRIX3 rot1=RotationMatrix(_V(0,(90-Long)*RAD,0*RAD),TRUE);
MATRIX3 rot2=RotationMatrix(_V((-Lat)*RAD,0,0*RAD),TRUE);
MATRIX3 RotMatrix_Def=mul(rot1,rot2);
vs.arot.x=atan2(RotMatrix_Def.m23,RotMatrix_Def.m33);
vs.arot.y=-asin(RotMatrix_Def.m13);
vs.arot.z=atan2(RotMatrix_Def.m12,RotMatrix_Def.m11);
oapiCreateVesselEx(name,module,&vs);
///////
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
Thanks. But for now I am just using using the set touchdown format like in 2010 for now.

Just looking at the code:

Not sure what to modify to get it to move the slscrawler? I pm what code I have to you.
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
Thanks. But for now I am just using using the set touchdown format like in 2010 for now.

Just looking at the code:

Not sure what to modify to get it to move the slscrawler? I pm what code I have to you.

Get from the code you sent to me the latitude, longitude and heading values and plug it here. I think you should not copy and paste code anyway but try to understand it, otherwise it's a big mess
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
Thanks.

Ok so doesn't this code, increase the lat and lng of the vessel because we are moving forward and set it?

Code:
 if (FWD)
    {

        VESSELSTATUS2 vs2;
        memset(&vs2, 0, sizeof(vs2));
        vs2.version = 2;
        GetStatusEx(&vs2);

        double d_lat = (Speed*oapiGetSimStep()*cos(vs2.surf_hdg)) / each_deg;
        double d_lng = (Speed*oapiGetSimStep()*sin(vs2.surf_hdg)) / each_deg;
        vs2.surf_lat += d_lat*RAD;
        vs2.surf_lng += d_lng*RAD;

       
        DefSetStateEx(&vs2);
        return;
    }
no heading change as yet.

So if going forward increase the lat and long of the vessel and set/move it
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
Thanks.

Ok so doesn't this code, increase the lat and lng of the vessel because we are moving forward and set it?

Code:
 if (FWD)
    {

        VESSELSTATUS2 vs2;
        memset(&vs2, 0, sizeof(vs2));
        vs2.version = 2;
        GetStatusEx(&vs2);

        double d_lat = (Speed*oapiGetSimStep()*cos(vs2.surf_hdg)) / each_deg;
        double d_lng = (Speed*oapiGetSimStep()*sin(vs2.surf_hdg)) / each_deg;
        vs2.surf_lat += d_lat*RAD;
        vs2.surf_lng += d_lng*RAD;

       
        DefSetStateEx(&vs2);
        return;
    }
no heading change as yet.

So if going forward increase the lat and long of the vessel and set/move it

yep it should that, just add this to plug in the proper arot parameter:
Code:
MATRIX3 rot1=RotationMatrix(_V(0,(90-Long)*RAD,0*RAD),TRUE);
MATRIX3 rot2=RotationMatrix(_V((-Lat)*RAD,0,0*RAD),TRUE);
MATRIX3 RotMatrix_Def=mul(rot1,rot2);
vs.arot.x=atan2(RotMatrix_Def.m23,RotMatrix_Def.m33);
vs.arot.y=-asin(RotMatrix_Def.m13);
vs.arot.z=atan2(RotMatrix_Def.m12,RotMatrix_Def.m11);
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
OK. I am not sure about the matrix 3 part.

I have this:
Code:
MATRIX3 SLSCRAWLER::RotationMatrix(VECTOR3 angles, bool xyz)
{
	MATRIX3 m;
	MATRIX3 RM_X, RM_Y, RM_Z;
	RM_X = _M(1, 0, 0, 0, cos(angles.x), -sin(angles.x), 0, sin(angles.x), cos(angles.x));
	RM_Y = _M(cos(angles.y), 0, sin(angles.y), 0, 1, 0, -sin(angles.y), 0, cos(angles.y));
	RM_Z = _M(cos(angles.z), -sin(angles.z), 0, sin(angles.z), cos(angles.z), 0, 0, 0, 1);
	if (!xyz)
	{
		m = mul(RM_Z, mul(RM_Y, RM_X));
	}
	else{
		m = mul(RM_X, mul(RM_Y, RM_Z));
	}
	return m;
}




void SLSCRAWLER::MoveAround(bool FWD, bool BWD, bool LFT, bool RGT)
{
	if (FWD)
	{

		VESSELSTATUS2 vs2;
		memset(&vs2, 0, sizeof(vs2));
		vs2.version = 2;
		GetStatusEx(&vs2);

		double d_lat = (Speed*oapiGetSimStep()*cos(vs2.surf_hdg)) / each_deg;
		double d_lng = (Speed*oapiGetSimStep()*sin(vs2.surf_hdg)) / each_deg;
		vs2.surf_lat += d_lat*RAD;
		vs2.surf_lng += d_lng*RAD;

		MATRIX3 rot1 = RotationMatrix(_V(0, (90 - Long)*RAD, 0 * RAD), TRUE);
		MATRIX3 rot2 = RotationMatrix(_V((-Lat)*RAD, 0, 0 * RAD), TRUE);
		MATRIX3 RotMatrix_Def = mul(rot1, rot2);
		vs.arot.x = atan2(RotMatrix_Def.m23, RotMatrix_Def.m33);
		vs.arot.y = -asin(RotMatrix_Def.m13);
		vs.arot.z = atan2(RotMatrix_Def.m12, RotMatrix_Def.m11);
		DefSetStateEx(&vs2);
		return;
	}

Not sure what the H would look like.
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
Long and Lat shall be vs2.srf_lng etc.

Also i think this will put the crawler pointing up in the sky. There should be also another rotation matrix of 90deg around x axis
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,724
Reaction score
2,689
Points
203
Location
Dallas, TX
ok Thanks. now I have this:
Code:
MATRIX3 SLSCRAWLER::RotationMatrix(VECTOR3 angles, bool xyz)
{
	MATRIX3 m;
	MATRIX3 RM_X, RM_Y, RM_Z;
	RM_X = _M(1, 0, 0, 0, cos(angles.x), -sin(angles.x), 0, sin(angles.x), cos(angles.x));
	RM_Y = _M(cos(angles.y), 0, sin(angles.y), 0, 1, 0, -sin(angles.y), 0, cos(angles.y));
	RM_Z = _M(cos(angles.z), -sin(angles.z), 0, sin(angles.z), cos(angles.z), 0, 0, 0, 1);
	if (!xyz)
	{
		m = mul(RM_Z, mul(RM_Y, RM_X));
	}
	else{
		m = mul(RM_X, mul(RM_Y, RM_Z));
	}
	return m;
}




void SLSCRAWLER::MoveAround(bool FWD, bool BWD, bool LFT, bool RGT)
{
	if (FWD)
	{

		VESSELSTATUS2 vs2;
		memset(&vs2, 0, sizeof(vs2));
		vs2.version = 2;
		GetStatusEx(&vs2);

		double d_lat = (Speed*oapiGetSimStep()*cos(vs2.surf_hdg)) / each_deg;
		double d_lng = (Speed*oapiGetSimStep()*sin(vs2.surf_hdg)) / each_deg;
		vs2.surf_lat += d_lat*RAD;
		vs2.surf_lng += d_lng*RAD;

		OBJHANDLE hearth = oapiGetObjectByName("Earth");
		vs.rbody = hearth;
		vs.status = 1;
		vs.surf_lng = Long*RAD;
		vs.surf_lat = Lat*RAD;
		vs.surf_hdg = Heading*RAD;




		MATRIX3 rot1 = RotationMatrix(_V(0, (90 - Long)*RAD, 0 * RAD), TRUE);
		MATRIX3 rot2 = RotationMatrix(_V((-Lat)*RAD, 0, 0 * RAD), TRUE);
		MATRIX3 RotMatrix_Def = mul(rot1, rot2);
		vs.arot.x = atan2(RotMatrix_Def.m23, RotMatrix_Def.m33);
		vs.arot.y = -asin(RotMatrix_Def.m13);
		vs.arot.z = atan2(RotMatrix_Def.m12, RotMatrix_Def.m11);
		DefSetStateEx(&vs2);
		return;
	}

h:
Code:
	MATRIX3 SLSCRAWLER::RotationMatrix(VECTOR3 angles, bool xyz);

	double Long, Lat, Heading;

So now when I press forward I get spinning on the x axis
Code:
-		arot	{data=0x00a7fd0c {-2.2273208457196496, -0.43283223155581330, 2.1127542534670511} x=-2.2273208457196496 ...}	VECTOR3
+		data	0x00a7fd0c {-2.2273208457196496, -0.43283223155581330, 2.1127542534670511}	double[3]
		x	-2.2273208457196496	double
		y	-0.43283223155581330	double
		z	2.1127542534670511	double
		surf_lng	-1.4080600471031084	double
		surf_lat	0.49781269181217641	double
		surf_hdg	3.1415926535897931	double
		d_lat	-0.00019577111553910787	double
+		rot2	{data=0x00a7fbe0 {1.0000000000000000, 0.00000000000000000, 0.00000000000000000, 0.00000000000000000, ...} ...}	MATRIX3
		d_lng	2.3975047001047510e-020	double
+		rot1	{data=0x00a7fc30 {0.99819293187656777, 0.00000000000000000, 0.060090521312946420, 0.00000000000000000, ...} ...}	MATRIX3
-		RotMatrix_Def	{data=0x00a7fb90 {0.99819293187656777, 0.0036108707516616678, 0.059981933647361367, 0.00000000000000000, ...} ...}	MATRIX3
+		data	0x00a7fb90 {0.99819293187656777, 0.0036108707516616678, 0.059981933647361367, 0.00000000000000000, 0.99819293187656777, ...}	double[9]
		m11	0.99819293187656777	double
		m12	0.0036108707516616678	double
		m13	0.059981933647361367	double
		m21	0.00000000000000000	double
		m22	0.99819293187656777	double
		m23	-0.060090521312946420	double
		m31	-0.060090521312946420	double
		m32	0.059981933647361367	double
		m33	0.99638912924833822	double

SCENARIO:
CRAWL:SLSCRAWLER
STATUS Landed Earth
POS -80.6758980 28.5198590
HEADING 180.00
ALT 0.000
AROT -127.791 -19.651 131.525
AFCMODE 7
NAVFREQ 0 0
END
 
Last edited:

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
it's the other way around!!! You don't have to use new variables for long and lat, just plug into the matrix vs2.surf_lng and vs2.surf_lat! And here you re using some undeclared and also uninitialized vs.srf_lng instead of vs2!
For example:


MATRIX3 rot1 = RotationMatrix(_V(0, (90*RAD - vs2.surf_lng), 0 * RAD), TRUE);

Just check thay vs2.surf_lng is in deg or rad, i can't remember it now
 
Last edited:
Top