General Question simple vc help

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Ok. This is got me confused.

A simple VC. 3 mesh groups (2mfds and 1 hud)

kiCtlbc.jpg


But for some reason the left mfd is drawn on the hud screen also.
p1CJJRY.jpg


tells which mesh group to assign for hud and mfd

Code:
mfds_left.ngroup = 0;
	mfds_right.ngroup = 2;

	huds.ngroup = 1;
	huds.size = 0.25;

tells the mesh #1 is the VC mesh

Code:
	SetMeshVisibilityMode(AddMesh(cmMesh, &ofs), MESHVIS_EXTERNAL | MESHVIS_VC); //mesh number 0
	SetMeshVisibilityMode(AddMesh(vcMesh, &ofs), MESHVIS_EXTERNAL | MESHVIS_VC); //mesh number 1




	mfds_left.nmesh = 1;
	mfds_right.nmesh = 1;


		huds.nmesh = 1;
	huds.hudcnt = ofs_hud;
turn on vc
Code:
bool TALON::clbkLoadVC(int id)
	{
		SetCameraDefaultDirection(_V(0, -0.25, 0.97)); // forward

		oapiVCRegisterHUD(&huds);
		oapiVCRegisterMFD(MFD_LEFT, &mfds_left);
		oapiVCRegisterMFD(MFD_RIGHT, &mfds_right);
		//	oapiVCRegisterMFD (MFD_LEFT, &mfds_co);  // was commented
		return true;
	}
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Which groups did you assign?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
kiCtlbc.jpg




Code:
mfds_left.ngroup = 0;
    mfds_right.ngroup = 2;

    huds.ngroup = 1;
    huds.size = 0.25;
HERE. Left Mfd is assigned group 0
right mfd is assigned group 2

and hud group 1

Only 3 groups in the VC mesh
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,873
Reaction score
2,868
Points
188
Website
github.com
Are you using the same texture on all 3 groups? (I don't think you need any in those groups)
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Are you using the same texture on all 3 groups? (I don't think you need any in those groups)

Yes. It is the same as the Orion MPCV It is just a blank texture with a x on it.

All three are drawn. But the left mfd is also drawn on the HUd group

Thanks
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,873
Reaction score
2,868
Points
188
Website
github.com
Yes. It is the same as the Orion MPCV It is just a blank texture with a x on it.

All three are drawn. But the left mfd is also drawn on the HUd group

Thanks

Try TEXTURE 0 in the mesh.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Ok. So no texture? I can do that

Some sort of a step between. No texture, but texture coordinates. For that you traditionally need to texture a group and then delete the texture line in the mesh.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Oh. Ok I will try it.
Thanks

---------- Post added at 05:31 PM ---------- Previous post was at 10:28 AM ----------

Now I just get the hud:
KKFlzbt.jpg

Code:
MSHX1
GROUPS 3   ;Exporter: Msh export 070514;
LABEL LEFTMFD
MATERIAL 1     ; -- default --;
TEXTURE 0
GEOM 4 2
-0.552624 1.094800 2.737859 -0.000000 0.609901 -0.792442 0.000500 0.999500
-0.240903 1.304132 2.898971 -0.000000 0.609901 -0.792442 0.999500 0.000500
-0.240903 1.094800 2.737859 -0.000000 0.609901 -0.792442 0.999500 0.999500
-0.552624 1.304132 2.898971 -0.000000 0.609901 -0.792442 0.000500 0.000500
0 1 2
3 1 0
LABEL HUD
GEOM 4 2
-0.158606 1.093900 2.738760 -0.000000 0.609901 -0.792442 0.000500 0.999500
0.153105 1.303231 2.899870 -0.000000 0.609901 -0.792442 0.999500 0.000500
0.153105 1.093900 2.738760 -0.000000 0.609901 -0.792442 0.999500 0.999500
-0.158606 1.303231 2.899870 -0.000000 0.609901 -0.792442 0.000500 0.000500
0 1 2
3 1 0
LABEL RIGHTMFD
GEOM 4 2
0.253422 1.093900 2.738859 -0.000000 0.609901 -0.792442 0.000500 0.999500
0.565134 1.303231 2.899971 -0.000000 0.609901 -0.792442 0.999500 0.000500
0.565134 1.093900 2.738859 -0.000000 0.609901 -0.792442 0.999500 0.999500
0.253422 1.303231 2.899971 -0.000000 0.609901 -0.792442 0.000500 0.000500
0 1 2
3 1 0
MATERIALS 1
 -- default --
MATERIAL  -- default --
0.878431 0.878431 0.878431 1.000000
0.878431 0.878431 0.878431 1.000000
1.000000 1.000000 1.000000 1.000000  20
0.000000 0.000000 0.000000 1.000000
TEXTURES 0

and they are on in the non vc mode:
Code:
BEGIN_HUD
  TYPE Surface
END_HUD

BEGIN_MFD Left
  TYPE Map
  REF Earth
  POS 0.00 0.00
END_MFD

BEGIN_MFD Right
  TYPE Surface
  SPDMODE 1
END_MFD

BEGIN_VC
END_VC
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,873
Reaction score
2,868
Points
188
Website
github.com
Not sure what happens when groups don't have the TEXTURE and MATERIAL entries... anyway, I think the MFDs need to have a material with the last line at "1 1 1 1", or they won't be visible.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Well I did this:
Code:
MATERIAL  -- default --
0.878431 0.878431 0.878431 1.000000
0.878431 0.878431 0.878431 1.000000
1.000000 1.000000 1.000000 1.000000  20
0.800000 0.800000 0.800000 1.000000

I can see them. But the Left mfd is drawn on the center mesh group also
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,873
Reaction score
2,868
Points
188
Website
github.com
How about this:
Code:
MSHX1
GROUPS 3   ;Exporter: Msh export 070514;
LABEL LEFTMFD
MATERIAL 1     ; -- default --;
TEXTURE 0
GEOM 4 2
-0.552624 1.094800 2.737859 -0.000000 0.609901 -0.792442 0.000500 0.999500
-0.240903 1.304132 2.898971 -0.000000 0.609901 -0.792442 0.999500 0.000500
-0.240903 1.094800 2.737859 -0.000000 0.609901 -0.792442 0.999500 0.999500
-0.552624 1.304132 2.898971 -0.000000 0.609901 -0.792442 0.000500 0.000500
0 1 2
3 1 0
LABEL HUD
MATERIAL 1     ; -- default --;
TEXTURE 0
GEOM 4 2
-0.158606 1.093900 2.738760 -0.000000 0.609901 -0.792442 0.000500 0.999500
0.153105 1.303231 2.899870 -0.000000 0.609901 -0.792442 0.999500 0.000500
0.153105 1.093900 2.738760 -0.000000 0.609901 -0.792442 0.999500 0.999500
-0.158606 1.303231 2.899870 -0.000000 0.609901 -0.792442 0.000500 0.000500
0 1 2
3 1 0
LABEL RIGHTMFD
MATERIAL 1     ; -- default --;
TEXTURE 0
GEOM 4 2
0.253422 1.093900 2.738859 -0.000000 0.609901 -0.792442 0.000500 0.999500
0.565134 1.303231 2.899971 -0.000000 0.609901 -0.792442 0.999500 0.000500
0.565134 1.093900 2.738859 -0.000000 0.609901 -0.792442 0.999500 0.999500
0.253422 1.303231 2.899971 -0.000000 0.609901 -0.792442 0.000500 0.000500
0 1 2
3 1 0
MATERIALS 1
 -- default --
MATERIAL  -- default --
0.878431 0.878431 0.878431 1.000000
0.878431 0.878431 0.878431 1.000000
1.000000 1.000000 1.000000 1.000000  20
0.800000 0.800000 0.800000 1.000000
TEXTURES 0
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Well it is drawn correctly except the HUd is too bright?
MFNYKwq.jpg
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,873
Reaction score
2,868
Points
188
Website
github.com
You need a different material for the HUD then.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
Well I got it work. Thanks

Now I am trying to get 3 working MFDs and a hud. I am using the code for the Endurance. But keep getting ctd when going to VC.

But I remember a guide to set but working buttons on mfd but can't seem to find it now:(
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Well I got it work. Thanks

Now I am trying to get 3 working MFDs and a hud. I am using the code for the Endurance. But keep getting ctd when going to VC.

But I remember a guide to set but working buttons on mfd but can't seem to find it now:(

Small hint: A good way to prevent CTDs in C++ is to make sure you know which variable exists when and when the memory location of this variable is used for something else.

Variable scopes is a common problem in C and C++ because of the pointers. Sometimes its no problem, because you just do a call by reference. Sometimes it fails, because the called Orbiter API stored the pointer to the object and expects you to keep this object in memory until ovcExit.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire

That is for the new Panel2D interface ... with a "PanelMaker" class, this interface could be much more useful for developers I think, right now its a bit too low-level for easy changes.

I think he means the example about how to define a third MFD in Orbiter with custom buttons.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
No but that might help. This was on the Hangar. I remember I got the buttons to work but not labels
 
Top