Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > MFD Questions & Help
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Notices

MFD Questions & Help Post your questions here for help with the Multi-Function Displays.

Reply
 
Thread Tools
Old 03-14-2012, 04:08 PM   #1
N_Molson
Addon Developer
 
N_Molson's Avatar

Question [Solved] Using TransX with an Y-axis aligned vessel

Hi,

I was wondering if there is a way to use the TransX bullseye to get the direction of the velocity vector when the main thruster of the ship is not Z-aligned but Y-aligned (prograde direction Y+ or _V(0,1,0) ) ? Is there an option or a config parameter that can allow to take that into account ?

Any ideas welcome,

(Suggestions of other MFDs count too)

Last edited by N_Molson; 04-14-2012 at 10:47 AM.
N_Molson is offline   Reply With Quote
Old 03-14-2012, 06:12 PM   #2
agentgonzo
Grounded since '09
 
agentgonzo's Avatar
Default

No, there isn't.
agentgonzo is offline   Reply With Quote
Thanked by:
Old 03-14-2012, 06:17 PM   #3
N_Molson
Addon Developer
 
N_Molson's Avatar

Default

Any chance it could be implemented in a future release ?
N_Molson is offline   Reply With Quote
Old 03-14-2012, 06:35 PM   #4
ED_4
Whovian/Star Trekker/Pinoy
 
ED_4's Avatar
Default

You do it simply by manually translating yourself sideways. That is all you'd need to do. In space you have the ability to translate sideways.

What you need to do is roll yourself sideways 90 degrees then translate to the side (+ or -) that needs correction.
ED_4 is offline   Reply With Quote
Old 03-14-2012, 06:50 PM   #5
N_Molson
Addon Developer
 
N_Molson's Avatar

Default

Quote:
You do it simply by manually translating yourself sideways. That is all you'd need to do. In space you have the ability to translate sideways.
Yes, of course, I'm going to perform a 3200 m/s TLI burn with 100N N204/MMH RCS thrusters ?

I'm speaking of a realistic ship...
N_Molson is offline   Reply With Quote
Old 03-14-2012, 07:06 PM   #6
ED_4
Whovian/Star Trekker/Pinoy
 
ED_4's Avatar
Default

Quote:
Originally Posted by N_Molson View Post
 Yes, of course, I'm going to perform a 3200 m/s TLI burn with 100N N204/MMH RCS thrusters ?

I'm speaking of a realistic ship...
LOL Then you should have thought of getting up to the higher plane from the get go. That was your mistake there.
ED_4 is offline   Reply With Quote
Old 03-14-2012, 07:12 PM   #7
N_Molson
Addon Developer
 
N_Molson's Avatar

Default

Sorry, I don't get what you mean.
N_Molson is offline   Reply With Quote
Old 03-14-2012, 07:37 PM   #8
ED_4
Whovian/Star Trekker/Pinoy
 
ED_4's Avatar
Default

Ok since the RCS is a smaller engine. Why not point your big engines to the opposite direction of where you should go. Instead of translating sideways. Yaw yourself 90 degrees from your pointing from prograde and point your nose to the direction you want to go to. Is that so difficult to imagine?

Or if you don't have the fuel. The reason I said the above is that the beginning of your flight is what is crucial in getting you to that higher plane. If you don't start pointing it from the start you'll never get to that higher plane. That's what I'm trying to tell you above.

Last edited by ED_4; 03-14-2012 at 07:39 PM.
ED_4 is offline   Reply With Quote
Old 03-14-2012, 07:50 PM   #9
N_Molson
Addon Developer
 
N_Molson's Avatar

Default

Well, I'm doing a trans-lunar off-plane transfer with very tight fuel budget, so I need to optimize everything.

Yes, the idea is to change the attitude by 90 and it's why I tried, but the problem is a lack of reference. OrbitMFD works in a very different way with a Y-axis oriented spacecraft (rather an assembly of spacecrafts, there). Also, I can't count on killrot (doesn't work with the shifted axis).

So I found an approximate method using the shifted OrbitMFD, but it lacks of precision.
N_Molson is offline   Reply With Quote
Old 03-15-2012, 10:49 AM   #10
agentgonzo
Grounded since '09
 
agentgonzo's Avatar
Default

Quote:
Originally Posted by N_Molson View Post
 Any chance it could be implemented in a future release ?
If you can find someone with the time to implement it, then yes. It's all opensource afterall.
agentgonzo is offline   Reply With Quote
Thanked by:
Old 03-15-2012, 04:22 PM   #11
dgatsoulis
Orbinaut
 
dgatsoulis's Avatar
Default

The best way would be to make the burn using IMFD. It handles Y axis burns pretty well. Here is an example of a ship with the Y axis burn direction (CEV-E-LM)

Here it is oriented for the burn.



If you don't want to use the AutoBurn autopilot but make the burn manually instead, you have to get the vectors centered. (Picture2 - Cross in the middle and the small arrows aligned).

Hope this helps.
dgatsoulis is online now   Reply With Quote
Thanked by:
Old 03-16-2012, 06:52 PM   #12
N_Molson
Addon Developer
 
N_Molson's Avatar

Default

Quote:
If you can find someone with the time to implement it, then yes. It's all opensource afterall.
Downloaded the source package. Is that the part I'm searching for (in graph.cpp) ?

Code:
double Graph::vectorpointdisplay(HDC hDC, const VECTOR3 &target, MFD *mfd, VESSEL *vessel, bool isposition)
//targetvector is a vector in the global reference plane
//isposition true
{
	VECTOR3 trtarget,temp;
	VESSELSTATUS status;
	if (isposition)
	{
		vessel->GetGlobalPos(temp);
		temp=target-temp;
	}
	else
	{
		temp=target;
	}
	vessel->GetStatus(status);
	VECTOR3 arot=status.arot;
	MATRIX3 rotmatrix;
	getinvrotmatrix(arot,&rotmatrix);
	trtarget = mul(rotmatrix, temp);
	int lines=int(windowsize/10);
	int edge=int(windowsize/1.5);
	int centre=int(windowsize/3);
	HPEN pen;
	pen=mfd->SelectDefaultPen(hDC,TransXFunction::White);
	Arc(hDC, ixstart,iystart+lines,ixstart+edge,iystart+edge+lines,ixstart,iystart+centre,ixstart,iystart+centre);
	edge-=centre/3;
	int nearedge=centre/3;
	Arc(hDC,ixstart+nearedge,iystart+nearedge+lines,ixstart+edge,iystart+edge+lines,ixstart+nearedge,iystart+centre,ixstart+nearedge,iystart+centre);
	edge-=centre/3;
	nearedge+=centre/3;
	Arc(hDC,ixstart+nearedge,iystart+nearedge+lines,ixstart+edge,iystart+edge+lines,ixstart+nearedge,iystart+centre,ixstart+nearedge,iystart+centre);
	edge=int(windowsize/1.5);
	MoveToEx(hDC,ixstart+centre,iystart+lines,NULL);
	LineTo(hDC,ixstart+centre,iystart+edge+lines);
	MoveToEx(hDC,ixstart,iystart+centre+lines,NULL);
	LineTo(hDC, ixstart+edge,iystart+centre+lines);
	double offsetsize=sqrt(trtarget.x*trtarget.x+trtarget.y*trtarget.y);
	double scalar=sqrt(2.0) / 2;
	double xang=trtarget.x/offsetsize;
	double yang=-trtarget.y/offsetsize;
	offsetsize=sqrt(offsetsize/trtarget.z);
	if (offsetsize>scalar || trtarget.z<0) offsetsize=scalar;
	offsetsize=offsetsize/scalar*windowsize/3;
	int xpos=int(offsetsize*xang+centre+ixstart);
	int ypos=int(offsetsize*yang+centre+lines+iystart);
	pen=mfd->SelectDefaultPen(hDC,TransXFunction::Green);
	MoveToEx(hDC,xpos-3,ypos-3,NULL);
	LineTo(hDC,xpos+3,ypos+3);
	MoveToEx(hDC,xpos-3,ypos+3,NULL);
	LineTo(hDC,xpos+3,ypos-3);
	return length(trtarget);
}
N_Molson is offline   Reply With Quote
Old 03-18-2012, 09:19 AM   #13
agentgonzo
Grounded since '09
 
agentgonzo's Avatar
Default

Yes, that's the right one.
agentgonzo is offline   Reply With Quote
Thanked by:
Old 04-14-2012, 10:46 AM   #14
N_Molson
Addon Developer
 
N_Molson's Avatar

Default

Ok I've managed to recompile the MFD and made a modification attempt... But then the problem is my non-comprehension of the maths/physics involved there.

I think I've tracked down the vector that holds the vessel orientation (arot vector). So my idea was to crossproduct the vector (supposed to be _V(0,0,1) in a "default" orientation) with _V(1,0,0) to have _V(0,1,0), or an y-axis output. But it does not work and I still can't get the proper vector display in Orbiter.

I feel that basic vector skills (that I don't have) could help to solve this, because the idea is only to feed TransX bullseye display with a modified vector. Any idea ? It would help a lot my lunar lander project

Code:
double Graph::vectorpointdisplay(HDC hDC, const VECTOR3 &target, MFD *mfd, VESSEL *vessel, bool isposition)
//targetvector is a vector in the global reference plane
//isposition true
{
	VECTOR3 trtarget,temp;
	VESSELSTATUS status;
	if (isposition)
	{
		vessel->GetGlobalPos(temp);	 // input : vessel global pos
		temp=target-temp;
	}
	else
	{
		temp=target;
	}
	vessel->GetStatus(status);
	VECTOR3 arot=status.arot;	// there
	arot =	crossp(arot, _V(1,0,0)); // failed conversion attempt 
	MATRIX3 rotmatrix;
	getinvrotmatrix(arot,&rotmatrix);
	trtarget = mul(rotmatrix, temp);
        ... then more graphical stuff...


---------- Post added at 10:46 AM ---------- Previous post was at 01:42 AM ----------

In a moment of lucidity, I found out the answer.

There is only one line to change, in the same section than posted above :

from :

Code:
double yang=-trtarget.y/offsetsize;
to :

Code:
double yang=-trtarget.z/offsetsize;
That did it nicely. It also works with Deltaglider-type vessels that have hover and main engines. Imagine that your favorite XR engines fail ; with this you can continue the navigation on the hovers (though you have to re-calculate the burn durations, which is not that hard).
N_Molson is offline   Reply With Quote
Old 04-17-2012, 08:49 PM   #15
Hlynkacg
Aspiring rocket scientist
 
Hlynkacg's Avatar


Default

So is this an independant MFD or does transX now align all vessels along the Y axis?

Likewise, how hard would it be to apply this to an independant (vessel) autopilot or HUD. I've been struggling with off-axis thrust in my own projects and this seems like it could help a lot.
Hlynkacg is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > MFD Questions & Help


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 06:00 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2007 - 2012, Orbiter-Forum.com. All rights reserved.