[GRASS5] Re: nviz testing

Paul Kelly paul-grass at stjohnspoint.co.uk
Fri Feb 28 04:47:12 EST 2003


On Thu, 27 Feb 2003, Helena wrote:

> I did not have a chance to test thoroughly the load/save 3d view option
> although it seems to work OK (except for the GUI update) - maybe
> somebody who uses 3dview could test it further.

This is a coincidence as I was looking at that yesterday, although I
didn't test any of the other new features. I found that I needed to set
the height and exaggeration manually to the same values as in the 3dview
file before loading it; these weren't updated. But after doing that it
worked all right, apart from one bug relating to the interpretation of the
twist (i.e. roll) angle in the 3dview file.

A) The value is already stored in 10ths of degrees in the 3dview file so
it doesn't need to be scaled when reading it in [nviz save 3dview already
took account of this so load/save aren't consistent]

B) In the geoview struct a comment says the direction of rotation is
right-handed, i.e. clockwise facing away from the origin. But both d.3d
and SG3d interpret the value as a twist in the (unconventional)
anti-clockwise direction. As this seems to be the GRASS convention
therefore I think nviz should be changed to take account of this- simply
putting a minus sign in front of the value saved / loaded from the 3dview
file. [nviz load and save 3dview were both consistent in this regard, but
files saved by nviz weren't consistent when viewed in SG3d or d.3d].

Another issue is that the geoview struct used by nviz stores the twist and
field of view angles (and possibly others) in an int data type, whereas in
the 3dview stuct they are floats. As they are in 10ths of degrees the
maximum precision is only 0.1 degree. This loss of precision might be
significant for some applications. Does anybody know why they are ints in
nviz? To slightly reduce the effects of this anyway I could change the
code so it properly rounds the floats from the 3dview file to the nearest
int, instead of just truncating them with an (int) cast.

I have already fixed these bugs in my local version so if there are no
objections I will commit the changes to CVS later.

BTW it is really good that the nviz updates are now in CVS where everyone
can work on them and not have to worry about updating old versions of the
files or changes being lost (this put me off trying to change anything
before). Very good work by Bob.

Paul





More information about the grass-dev mailing list