GINO Graphics Suite - GINO v9.0  

gGetView

Syntax

[C/C++:]
void gGetViewParams(GMATV vdata):
void gGetViewState(GVIEWSTATE vstate);
[F90:]
subroutine gGetViewParams(vdata)
subroutine gGetViewState(vstate)

real, intent(out) :: vdata(15)
type (GVIEWSTATE), intent(out) :: vstate

Arguments

vdata
Viewing data parameters

vstate.mode
View mode

= 0, No view defined
= 1, Perspective view defined (gDefineSphericalView() or gDefinePerspView())
= 2, Parallel view defined (gDefineParallelView())

vstate.cflag
View centre flag

= 0, No view centre defined
= 1, Default view centre defined
= 2, User defined view centre (gPosViewCentre())

vstate.upflag
View up direction flag

= 0, Default view up vector (0.0,1.0,0.0)
= 1, User defined view up vector (gSetViewUpDirection())

vstate.dir
View direction vector

vstate.centre
View centre

vstate.dist
Perspective viewing distance

vstate.shift
View shift

vstate.upvec
View up direction vector

Description

The routines gGetViewParams() and gGetViewState() return all the viewing parameters in either the array vdata or the structure vstate. The viewing parameters can be reset to the values stored in either structure by calling the appropriate setting routine gSetViewParams() or gSetViewState().

The current eye position can be calculated using the following formulae:

xeye = vstate.centre.x - vstate.dist * vstate.dir.x
yeye = vstate.centre.y - vstate.dist * vstate.dir.y
zeye = vstate.centre.z - vstate.dist * vstate.dir.z

Note that for parallel viws (mode = 2) vstate.dist will equal 0.0, so any arbitrary value for dist can be substituted to calculate a normal eye position.

See Also

gGetViewParams Usage
gSetViewParams
gSetViewState