[Flightgear-devel] Re:chase/cockpit view

2004-08-29 Thread Yu QingRou
I have another question regarding the view manager:
Is it possible in FlightGear, we can have two viewpoints at the same time? 
I found in some other flight simulator, for the panels/instruments, user 
sees with cockpit view, while at the same time, for the scenery outside the 
cockpit, it uses chase view so user can see the attitude of the 
aircraft.Or, we can say, the window of the simulator is splited to two 
small windows, one for panels/instruments using cockpit view while the 
other, using chase view.

By checking the codes, seems FlightGear doesn't support this. Any ideas 
about how to realize this? Though this functionality may not have too much 
value...:-(

Thanks & Regards,
QingRou
[Flightgear-devel] Re: chase/cockpit view
Melchior FRANZ mfranz at aon.at 
Sun Aug 1 09:31:31 CDT 2004 

Previous message: [Flightgear-devel] fgfs aborted with the dc3 
Next message: [Flightgear-devel] FlightGear v0.9.5 
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] 


* Sam -- Sunday 25 July 2004 18:33:
 can anybody give me an advice how to implement new view
inflightgear: a combination of cockpit and chase view - so that the
plane would be looked at from behind (like in chase mode) but at the
same time viewport behaviour would be the same as in cockpit - i mean
precise rotation (with no "delays" like in chase mode, [...]
Just leave the  settings in the view config away.
m.
_
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re:chase/cockpit view

2004-08-31 Thread Yu QingRou
Many thanks! I tried this yesterday and it works! Though seems you must add 
--enable-panel in the command line otherwise you can not make it. This is a 
little bit strange because by default this option is on. ( I am using 0.9.4 
version)

Thanks again!

From: Lee Elliott <[EMAIL PROTECTED]>
Reply-To: FlightGear developers discussions 
<[EMAIL PROTECTED]>
To: FlightGear developers discussions <[EMAIL PROTECTED]>
Subject: Re: [Flightgear-devel] Re:chase/cockpit view
Date: Sun, 29 Aug 2004 15:16:05 +0100
Hmm...  I've been commenting out the lines after the two you indicate to 
make
the panel visible in exterior views (with the forward view only) so the
relevant bit from my panel.cxx looks like:
bool
fgPanelVisible ()
{
 if(globals->get_current_panel() == 0)
return false;
 if(globals->get_current_panel()->getVisibility() == 0)
return false;
// if(globals->get_viewmgr()->get_current() != 0)
//  return false;
 if(globals->get_current_view()->getHeadingOffset_deg() *
SGD_DEGREES_TO_RADIANS != 0)
return false;
return true;
}
This patch was courtesy of one of the developers after I asked for the
facility.
I use this because I find it useful when developing aircraft.  I've been
meaning to make it configurable via the property tree, and then propose it
for inclusion for ages.
LeeE
On Sunday 29 August 2004 14:53, Harald JOHNSEN wrote:
> Yu QingRou wrote:
> > I have another question regarding the view manager:
> >
> > Is it possible in FlightGear, we can have two viewpoints at the same
> > time? I found in some other flight simulator, for the
> > panels/instruments, user sees with cockpit view, while at the same
> > time, for the scenery outside the cockpit, it uses chase view so user
> > can see the attitude of the aircraft.Or, we can say, the window of 
the
> > simulator is splited to two small windows, one for panels/instruments
> > using cockpit view while the other, using chase view.
> >
> > By checking the codes, seems FlightGear doesn't support this. Any
> > ideas about how to realize this? Though this functionality may not
> > have too much value...:-(
>
> The 2D panel allready uses a second viewpoints. I think you could try 
to
> play with this function
> in Cockpit/panel.cxx :
>
> bool
> fgPanelVisible ()
> {
> if(globals->get_current_panel() == 0)
> return false;
> if(globals->get_current_panel()->getVisibility() == 0)
> return false;
> //
> if(...)
> return true;
> ///
> if(globals->get_viewmgr()->get_current() != 0)
> return false;
> if(globals->get_current_view()->getHeadingOffset_deg() *
> SGD_DEGREES_TO_RADIANS != 0)
> return false;
> return true;
> }
> Perhaps you can add a property to trigger the 2D panel so its 
configurable.
>
> > Thanks & Regards,
> > QingRou
> >
> >
> > [Flightgear-devel] Re: chase/cockpit view
> > Melchior FRANZ mfranz at aon.at Sun Aug 1 09:31:31 CDT 2004
> > Previous message: [Flightgear-devel] fgfs aborted with the dc3 Next
> > message: [Flightgear-devel] FlightGear v0.9.5 Messages sorted by: [
> > date ] [ thread ] [ subject ] [ author ]
> > 
-
> >---
> >
> > * Sam -- Sunday 25 July 2004 18:33:
> >> can anybody give me an advice how to implement new view
> >> inflightgear: a combination of cockpit and chase view - so that the
> >> plane would be looked at from behind (like in chase mode) but at the
> >> same time viewport behaviour would be the same as in cockpit - i 
mean
> >> precise rotation (with no "delays" like in chase mode, [...]
> >
> > Just leave the  settings in the view config away.
> >
> > m.
> >
> > _
> > 与联机的朋友进行交流,请使用 MSN Messenger: 
http://messenger.msn.com/cn
> >
> > ___
> > Flightgear-devel mailing list
> > [EMAIL PROTECTED]
> > http://mail.flightgear.org/mailman/listinfo/flightgear-devel
> > 2f585eeea02e2c79d7b1d8c4963bae2d
>
> ___
> Flightgear-devel mailing list
> [EMAIL PROTECTED]
> http://mail.flightgear.org/mailman/listinfo/flightgear-devel
> 2f585eeea02e2c79d7b1d8c4963bae2d
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d
_
免费下载 MSN Explorer:   http://explorer.msn.com/lccn/  

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


[Flightgear-devel] Trajectory show when replay?

2004-10-19 Thread Yu QingRou
Hi,
I am trying to show the trajectory the aircraft just flied when start 
replaying. Is there anybody who had ever done that? Or could you give me 
some ideas about the solution?

I have successfully draw "points" along the trajectory by this way:
- In replay.hxx, define:
ssgRoot * _scene;
ssgSelector * _selector;
vector  * _trajectory;
ssgBranch * trajectories;
ssgBranch * fgLoadTrajectoryPoint();
void load();//get the (lon, lat, alt) from terms 
(short_term...long_term)
sgdVec3 * pos_v1;  //store the lon, lat, alt of each points.

- In replay.cxx,
1. fgLoadTrajectoryPoint():
Just clone the existing codes in acmodel.cxx which load the 3D model of the 
aircraft. I load a model of Point (like the light point showed in runway).
2. load():
Get the lon, lat, alt of each point in terms (short, mid, long). Store in 
pos_v1.
Then do some initializatioin:
   ssgBranch * trajectory = fgLoadTrajectoryPoint();
   for (int i=0; i
   {
   _trajectory = new SGModelPlacement;
   _trajectory -> init (trajectory);
   _trajectory -> setVisible(true);
   trajectories->addKid(_trajectory->getSceneGraph() );
   }
   _selector->addKid( trajectories );
   globals->get_scenery()->get_scene_graph()->addKid(_selector);
   
3. update():
   if ( replay_master->getBoolValue() ) {
   // don't record the replay session
   Point3D scenery_center = globals->get_scenery()->get_center();
   for (int i=0; i
   {
   (* _trajectory)[i]->setVisible(true);
   (* _trajectory)[i]->setPosition(pos_v1[i][0],
   pos_v1[i][1],
   pos_v1[i][2]);
   (* _trajectory)[i]->setOrientation(0.0, 0.0, 0.0);
   (* _trajectory)[i]->update( scenery_center );
}
  _trajectory -> setVisible(true);

By this way I showed the trajectory which is composed of "points" 
successfully. But now, I want to show "lines" for this trajectory and I 
found I may need to find out some other ways because it's improper to use 
SGModelPlacement here now. Another thing is I want to draw the vertical 
line of each "point"...I mean the line connecting the "point" and the 
current elev point of the terrain.

I tried a "dirty" but "fast"(I think) way like this but I failed to get 
what I want:

In the main.cxx, fgRenderFrame(), I add some codes like this:
if ( replay_master -> getBoolValue()){
  FGReplay *r = (FGReplay *)(globals->get_subsystem( "replay" ));
//nv is the size of pos_v1.
  if ((*r).nv > 0)
  {
 Point3D scenery_center = 
globals->get_scenery()->get_center();

 FGViewer *v = globals -> get_current_view();
 Point3D vp( v-> get_view_pos()[0],
 v-> get_view_pos()[1],
 v-> get_view_pos()[2]);
 for ( int i=0; i<(*r).nv; i++ )
 {
double lon_rad = ((*r).pos_v1[i][0]) * 
SGD_DEGREES_TO_RADIANS;
double lat_rad = ((*r).pos_v1[i][1]) * 
SGD_DEGREES_TO_RADIANS;
double elev = ((*r).pos_v1[i][2]) * SG_FEET_TO_METER;

   Point3D geod(lon_rad, lat_rad, elev);
   Point3D world_pos = sgGeodToCart( geod );
   Point3D offset = world_pos - scenery_center; //correct or 
not???
   offset = offset - vp;  //correct or not???

  (*r).view_pos1[i][0] = offset.x();
  (*r).view_pos1[i][1] = offset.y();
  (*r).view_pos1[i][2] = offset.z();
 }
  }
  glMatrixMode(GL_PROJECTION);
  glPushMatrix();
  glLoadIdentity();
  glMatrixMode(GL_MODELVIEW);
  glPushMatrix();
  glLoadIdentity();
  glLineWidth(10.0f);
  glColor3f(1.0,0.0,0.0);
  glBegin(GL_LINES);
  for ( int i=0; i<(*r).nv; i++ )
  {
glVertex3f((*r).view_pos1[i][0],
   (*r).view_pos1[i][1],
   (*r).view_pos1[i][2]);
  }
  glEnd();
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix();
  glMatrixMode(GL_PROJECTION);
  glPopMatrix();
   }
}
I failed to see the trajectory but just some random lines showed in the 
screen. Can anyone take some time to help me and shed some lights on this 
issue?

Thanks.
Regards,
Qingrou
_
免费下载 MSN Explorer:   http://explorer.msn.com/lccn/  

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Trajectory show when replay?

2004-10-21 Thread Yu QingRou
Thanks Arnt. Responses inline.
Other gents, have time to look into my questions in my previous email and 
help me out?

One question, if I have already know one point's (lat, lon, alt), how can I 
calculate a right position to draw it? I know it needs to be updated as the 
scenery center is being changed...I did some investigation but I have to 
say I messed up something. Can anyone give me a clarification on what 
procedures I should call...is the way I showed in my previous email 
correct?

> Hi,
>
> I am trying to show the trajectory the aircraft just flied when start
> replaying. Is there anybody who had ever done that?
..like Klog?  ' apt-get install klog ', if you use debian sid,
otherwise see http://kflog.org .
> Or could you give me some ideas about the solution?
..preliminary idea: Ethy Brito asked for help investigating a helicopter
crash using FG, if you _are_ doing what I think you are doing, chk out
http://baron.flightgear.org/pipermail/flightgear-users/2004-October/009104.html

and help us qualify FlightGear as an air crash investigation tool, your
trajectory code ideas are spot on what we need, if they are anywhere
near what I think they are.  :-)
..updated protocol handler for FG:
http://www.a1.nl/~ehofman/fgfs/downloads/j3cub
[QingRou] I saw Erik's email. Sounds like in the coming release we can have 
such functionality: save your flight to a file with the data need to be 
stored in FGReplayData (Sim_time, FDM and Ctrls). Then read this file back 
and replay the flight. This is useful especially for the instructors to 
show the students how a successful/bad flight is. Also it can be used to 
save students' flight and give scores.

..ca 2 hours Dolphin SA365 real life flight data for FG calibration:
http://www.inexo.com.br/SA365/SA365-flight007-aero-data.tar.gz
http://www.inexo.com.br/SA365/SA365-flight007-engine-data.tar.gz
..bonus extensions could be placing choppers or airplanes rather your
lines or dots along the trajectory trail,
[QingRou] Yes with my "point" (spot) solution, you can change the loading 
3D model to anything you want and then you can see the model showed along 
the trajectory. I had ever done that to show a rocket along the flight 
path!

maybe showing red wireframe
orientations etc "according to the black box recordings", and green,
blue, yellow etc wireframe orientations "according to the black box
recordings filtered thru the yasim, JSBSim, UIUC etc flight dynamics
models" to help understand the recordings and say, help identify
instrument errors disturbing the black box recordings.
[QingRou] Yeah...actually what I am doing is, read the record data from 
Flight Data Recorder (black box), and refine the data to some format, then 
input into the replay system of FlightGear. All the flight recorded by the 
FDR can be replayed. In a flight school, this can be used for the 
instructors to review the flight with the student and give some comments to 
his operation.

..Ethy?  You're still around?
--
..med vennlig hilsen = with Kind Regards from Arnt... ;-)
...with a number of polar bear hunters in his ancestry...
  Scenarios always come in sets of three:
  best case, worst case, and just in case.

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d
_
免费下载 MSN Explorer:   http://explorer.msn.com/lccn/  

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d