Re: [Flightgear-devel] 3D view goes away by itself
Thanks Curt and Phil. After looking around in the view manager and trying many different combinations of XML settings, I finally took the easy way out and changed the airborne clip plane distance in renderer.cxx to 0.5, rather than 10. That solves my problem, but don't know if anyone else would like that move :) Dave ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 3D view goes away by itself
From: Dave Culp Thanks Curt and Phil. After looking around in the view manager and trying many different combinations of XML settings, I finally took the easy way out and changed the airborne clip plane distance in renderer.cxx to 0.5, rather than 10. That solves my problem, but don't know if anyone else would like that move The issue would only be related to the width of the Z buffer. I was running a Voodoo card at the time I set up this feature where the depth buffer was cleared and reset between the scenery and the cockpit rendering. This may still be an issue for some current hardware configurations. You'd have to do the math to see what the functional far plane limitation is at 0.5m in order to anticipate what will and will not work. Visually, the problem will appear as oddities on the horizon due to depth test errors. Best, Jim ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 3D view goes away by itself
I finally took the easy way out and changed the airborne clip plane distance in renderer.cxx to 0.5, rather than 10. That solves my problem, but don't know if anyone else would like that move The issue would only be related to the width of the Z buffer. I was running a Voodoo card at the time I set up this feature where the depth buffer was cleared and reset between the scenery and the cockpit rendering. This may still be an issue for some current hardware configurations. You'd have to do the math to see what the functional far plane limitation is at 0.5m in order to anticipate what will and will not work. Visually, the problem will appear as oddities on the horizon due to depth test errors. Thanks Jim, I haven't seen any artifacts on the horizon, so it looks like setting the near plane to 0.5m works OK for me. FWIW, I'm running on nVidia MX-440. Dave ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] 3D view goes away by itself
I have a cockpit view system set up for the OV-10 sim that uses a 2D forward view and 3D side views (screenshot : http://home.comcast.net/~davidculp2/2D_3D_views.jpg It's controlled by some nasal scripts I bound to the arrow keys. Here are the up(forward) and left bindings: key n=356 nameLeft arrow/name descLook left./desc binding commandnasal/command script node = props.globals.getNode(/sim/current-view); if(node.getChild(view-number).getValue() == 0) { setprop(/sim/current-view/heading-offset-deg, getprop(/sim/view/config/left-direction-deg)); node.getChild(internal).setBoolValue(1); node.getChild(x-offset-m).setDoubleValue(0.0); node.getChild(y-offset-m).setDoubleValue(1.1); node.getChild(z-offset-m).setDoubleValue(-1.25); node.getChild(pitch-offset-deg).setDoubleValue(0.0); } /script /binding /key key n=357 nameUp arrow/name descLook forward./desc binding commandnasal/command script node = props.globals.getNode(/sim/current-view); if(node.getChild(view-number).getValue() == 0) { setprop(/sim/current-view/heading-offset-deg, getprop(/sim/view/config/front-direction-deg)); node.getChild(internal).setBoolValue(0); node.getChild(x-offset-m).setDoubleValue(0.0); node.getChild(y-offset-m).setDoubleValue(0.0); node.getChild(z-offset-m).setDoubleValue(0.0); node.getChild(pitch-offset-deg).setDoubleValue(-10.0); } /script /binding /key It works fine on the ground, but about 10 seconds after takeoff the 3D side views of the aircraft's engine/wing go away and never come back. I check through the property browser and all the values look unchanged. It seems like the internal boolean value must have changed, but the property browser does not indicate a change (even after a refresh of course). Any idea what causes the view to change by itself after takeoff? Thanks, Dave ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 3D view goes away by itself
Hmmm. I have something similar that works, but I don't see the important difference. I copied/modifed stepView() to be a stepCockpitView(). It does an explicit setprop(/sim/current-view/view-number, 0); which I believe forces a copyToCurrent() and an update(), but I'm not sure if that is the reason it works. The internal flag is set for each defined view in the constructor and the view manager copies the flag from the currently used view in copyToCurrent(). Is there any chance the node.getChild(view-number).getValue() == 0 is lying, .e.g. returning a zero when it cannot find a value? For reference, here is what I use and it seems to work: In view.nas ## # Handler. Step to the next in cockpit view. # # This assumes the cockpit is view 0 stepCockpitView = func { # switch to cockpit view setprop(/sim/current-view/view-number, 0); # determine the current cockpit view number curr = getprop(/sim/view/cockpit-view-number); cviews = props.globals.getNode(/sim/view).getChildren(cockpit-view); curr = curr + arg[0]; if (curr 0){ curr = size(cviews) - 1; } elsif(curr = size(cviews)) { curr = 0; } setprop(/sim/current-view/goal-heading-offset-deg, cviews[curr].getNode(heading).getValue()); setprop(/sim/view/cockpit-view-number, curr); # And pop up a nice reminder gui.popupTip( cviews[curr].getNode(name).getValue()); } In preferences.xml view nameInteranl View/name typelookfrom/type internal type=booltrue/internal config from-model type=booltrue/from-model from-model-idx type=int0/from-model-idx ground-level-nearplane-m type=double0.5f/ground-level-nearplane-m default-field-of-view-deg type=double55.0/default-field-of-view-deg default-pitch-deg type=double0/default-pitch-deg default-heading-deg type=double0/default-heading-deg front-direction-deg type=double0/front-direction-deg front-left-direction-deg type=double45/front-left-direction-deg left-direction-deg type=double90/left-direction-deg back-left-direction-deg type=double135/back-left-direction-deg back-direction-deg type=double180/back-direction-deg back-right-direction-deg type=double225/back-right-direction-deg right-direction-deg type=double270/right-direction-deg front-right-direction-deg type=double315/front-right-direction-deg x-offset-m type=double0/x-offset-m y-offset-m type=double0.8/y-offset-m z-offset-m type=double2.0/z-offset-m /config cockpit-view-number type=int0/cockpit-view-number cockpit-number-views type=int4/cockpit-number-views cockpit-view nameFront/name heading type=double0/heading /cockpit-view cockpit-view nameFront Right/name heading type=double315/heading /cockpit-view cockpit-view nameRear/name heading type=double180/heading /cockpit-view cockpit-view nameFront Left/name heading type=double45/heading /cockpit-view /view In keyboard.xml key n=86 nameV/name descScroll through cockpit views./desc binding commandnasal/command scriptview.stepCockpitView(1)/script /binding /key - Original Message - From: Dave Culp [EMAIL PROTECTED] To: FlightGear developers discussions flightgear-devel@flightgear.org Sent: Thursday, May 26, 2005 4:19 PM Subject: [Flightgear-devel] 3D view goes away by itself [ snip ] It works fine on the ground, but about 10 seconds after takeoff the 3D side views of the aircraft's engine/wing go away and never come back. I check through the property browser and all the values look unchanged. It seems like the internal boolean value must have changed, but the property browser does not indicate a change (even after a refresh of course). Any idea what causes the view to change by itself after takeoff? Thanks, Dave ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 3D view goes away by itself
Hmmm, After a few feet of altitude, FG changes the default near clip plane to be further away from the viewer. The 3d aircraft models are drawn with different view parameters so this shouldn't be a problem ... but maybe somehow your 3d model geometry isn't getting configured so it get's drawn at the right time in the pipeline as is getting clipped? Curt. Dave Culp wrote: I have a cockpit view system set up for the OV-10 sim that uses a 2D forward view and 3D side views (screenshot : http://home.comcast.net/~davidculp2/2D_3D_views.jpg It's controlled by some nasal scripts I bound to the arrow keys. Here are the up(forward) and left bindings: key n=356 nameLeft arrow/name descLook left./desc binding commandnasal/command script node = props.globals.getNode(/sim/current-view); if(node.getChild(view-number).getValue() == 0) { setprop(/sim/current-view/heading-offset-deg, getprop(/sim/view/config/left-direction-deg)); node.getChild(internal).setBoolValue(1); node.getChild(x-offset-m).setDoubleValue(0.0); node.getChild(y-offset-m).setDoubleValue(1.1); node.getChild(z-offset-m).setDoubleValue(-1.25); node.getChild(pitch-offset-deg).setDoubleValue(0.0); } /script /binding /key key n=357 nameUp arrow/name descLook forward./desc binding commandnasal/command script node = props.globals.getNode(/sim/current-view); if(node.getChild(view-number).getValue() == 0) { setprop(/sim/current-view/heading-offset-deg, getprop(/sim/view/config/front-direction-deg)); node.getChild(internal).setBoolValue(0); node.getChild(x-offset-m).setDoubleValue(0.0); node.getChild(y-offset-m).setDoubleValue(0.0); node.getChild(z-offset-m).setDoubleValue(0.0); node.getChild(pitch-offset-deg).setDoubleValue(-10.0); } /script /binding /key It works fine on the ground, but about 10 seconds after takeoff the 3D side views of the aircraft's engine/wing go away and never come back. I check through the property browser and all the values look unchanged. It seems like the internal boolean value must have changed, but the property browser does not indicate a change (even after a refresh of course). Any idea what causes the view to change by itself after takeoff? Thanks, Dave ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d -- Curtis Olsonhttp://www.flightgear.org/~curt HumanFIRST Program http://www.humanfirst.umn.edu/ FlightGear Project http://www.flightgear.org Unique text:2f585eeea02e2c79d7b1d8c4963bae2d ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d