David Megginson <[EMAIL PROTECTED]> said:
> David Megginson writes:
>
> > 3. The orientation is incorrect when the view is not straight forward
> > and the plane is not flying level (waiting for a fix from me, but I
> > don't understand matrix math well enough) -- that means that when you
> > look out the side window during a climb or turn, the model will not be
> > tilted correctly.
>
> Further to this point, could someone who understands matrix math take
> a look at src/Main/model.cxx, in the update() method? Where I have
>
> if (view_number == 0) {
>
// FIXME: orientation is not applied
>
// correctly when view is not forward
> sgMakeRotMat4( sgROT, -pilot_view->get_view_offset()
> * SGD_RADIANS_TO_DEGREES, pilot_view->get_world_up() );
> sgPreMultMat4( sgTRANS, sgROT );
> }
>
> I'm trying to keep the model from following the view around.
> Obviously, I have to do some rotations in other planes as well, but
> I'm not quite sure how to do it.
>
Think you have to decide which up vector to rotate. With the pilot-view the
world up vector gets rotated around the x and y. And with model view it gets
rotated around the same for the model's up vector. So pick one and it should
look fine. I guess I would recommend leaving the model fixed so that the
panel isn't bouncing all over the place. That alone would fix the problem.
As far as the matrix math, I think I know what to do, just not sure where the
model rotation is getting applied...see a possibility, but have to head out of
town now until tonight. Basically it is a matter of finding it and not
applying rotation to the model. I can see how getting all this into a single
view class would help here :-)
Best,
Jim
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel