General Question simple vc help

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
10,548
Reaction score
4,373
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;
	}
 
Which groups did you assign?
 
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
 
Are you using the same texture on all 3 groups? (I don't think you need any in those groups)
 
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
 
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.
 
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.
 
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
 
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.
 
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
 
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
 
You need a different material for the HUD then.
 
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:(
 
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.
 

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.
 
No but that might help. This was on the Hangar. I remember I got the buttons to work but not labels
 
Back
Top