Model Cockpit View: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
Line 37: Line 37:
   }}</ref>)
   }}</ref>)


== Changing the view point ==
= Changing the view point =
By default, the view point will be at (0,0,0), so the view point will be exactly on the bottom for many models. Though this might be useful for analysis purposes, a raised view point is more interesting. The view point can be changed by adding the following code to the addons main.nas file:
By default, the view point will be at (0,0,0), so the view point will be exactly on the bottom for many models. Though this might be useful for analysis purposes, a raised view point is more interesting. The view point can be changed by adding the following code to the addons main.nas file:


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
t.b.c.
        ...
        if (type != "multiplayer")
            color = { text: { color: { red: 0.5, green: 0.8, blue: 0.5 }}};
# move view point above back of vehicle.
if (getprop("/sim/current-view/name") == "Model Cockpit View" and name) {
if (string.match(name,"*gsvehicle*")){
#Ground Service vehicle
setprop("/sim/current-view/z-offset-m", 20);
setprop("/sim/current-view/y-offset-m", 7);
} else if (string.match(name,"*carrier*")){
setprop("/sim/current-view/z-offset-m", 110);
setprop("/sim/current-view/y-offset-m", 47);
} else {
#Aircraft?
setprop("/sim/current-view/z-offset-m", 60);
setprop("/sim/current-view/y-offset-m", 17);
}
}
        if (name)
            gui.popupTip(name, 2, color);
        ...
</syntaxhighlight>
</syntaxhighlight>
The offset values shown here are just arbitrary.


= References =
= References =

Revision as of 15:29, 6 December 2017

This article is a stub. You can help the wiki by expanding it.
Model Cockpit View
Jigsaw.png
Started in 07/2007
Description Model Cockpit View
Maintainer(s) AndersG
Contributor(s) AndersG, Melchior Franz, maybe others
Status Under active development as of 07/2007

Model Cockpit View is a FlightGear addon that allows to switch the view from any AI/MP models and cockpits. It is based on the previous modules model-view.xml, cockpit-view.xml and model2-view.xml. Q/q steps through the available MP/AI aircraft.

Issues

Currently the cockpit views starts at (0,0,0) which is a bit of a usability problem - it works for someone that knows it is a bit of a hack but looks bad for anyone else. The Q/q key binding might interfere with aircrafts that use these keys.

Status

AndersG created a version of the addon ([1]) that is available in http://www.gidenstam.org/FlightGear/misc/ModelCockpitView-addon.tar.gz.

wkitty42 is working on the addon. ([2])

Changing the view point

By default, the view point will be at (0,0,0), so the view point will be exactly on the bottom for many models. Though this might be useful for analysis purposes, a raised view point is more interesting. The view point can be changed by adding the following code to the addons main.nas file:

        ...
        if (type != "multiplayer")
            color = { text: { color: { red: 0.5, green: 0.8, blue: 0.5 }}};
# move view point above back of vehicle.
if (getprop("/sim/current-view/name") == "Model Cockpit View" and name) {
	if (string.match(name,"*gsvehicle*")){
		#Ground Service vehicle
		setprop("/sim/current-view/z-offset-m", 20);
		setprop("/sim/current-view/y-offset-m", 7);
	} else if (string.match(name,"*carrier*")){
		setprop("/sim/current-view/z-offset-m", 110);
		setprop("/sim/current-view/y-offset-m", 47);
	} else {
		#Aircraft?
		setprop("/sim/current-view/z-offset-m", 60);
		setprop("/sim/current-view/y-offset-m", 17);
	}
}
        if (name)
            gui.popupTip(name, 2, color);
        ...

The offset values shown here are just arbitrary.

References

References
  1. AndersG  (Aug 14th, 2017).  Re: .
  2. wkitty42  (Aug 13th, 2017).  Re: .