[GRASS5] [bug #1358] (grass) d.3d interactive more flexible than command line

this bug's URL: http://intevation.de/rt/webrt?serial_num=1358
-------------------------------------------------------------------------

I notice that one can manipulate a lot more of d.3d in interactive
mode than from the command line. Bummer. [GRASS 5.0.0pre1 (May 2001)]

By the way, too bad one must specify the coordinates of the to=, and
can't optionally give an angle instead.

OK, I suppose one writes scripts like 3d.view.sh.

BTW, I hope that earth's curvature is applied, as I am doing 1 degree
wide blowups of 50 km away mountains looking horizontally directly
across, in order to identify which mountains they were in family
snapshots.

And I sure wish the cursor would stay put, each time one does a run in
interactive mode, and not jump back to the first item.

BTW, interactive mode should allow one to continue after saving a
3d.view setting.

Also Grass interactive programs should use the readline library so one
can use C-p to recall earlier entries, etc.

In conclusion, I would like to click on a certain mountain in the
image created by d.3d to find more about it, e.g. coordinates, but
can't.
--
http://jidanni.org/ Taiwan(04)25854780

--- Headers Follow ---

From jidanni@dman.ddts.net Sun Oct 20 10:24:42 2002

Return-Path: <jidanni@dman.ddts.net>
Delivered-To: grass-bugs@lists.intevation.de
Received: from mail.intevation.de (aktaia [212.95.126.10])
  by lists.intevation.de (Postfix) with ESMTP id 6F3A01394F
  for <grass-bugs@lists.intevation.de>; Sun, 20 Oct 2002 10:24:42 +0200 (CEST)
Received: from msr.hinet.net (msr15.hinet.net [168.95.4.115])
  by mail.intevation.de (Postfix) with ESMTP id D9CDC1C251
  for <grass-bugs@intevation.de>; Sun, 20 Oct 2002 10:24:40 +0200 (CEST)
Received: from debian (61-227-44-135.HINET-IP.hinet.net [61.227.44.135])
  by msr.hinet.net (8.9.3/8.9.3) with ESMTP id QAA27353
  for <grass-bugs@intevation.de>; Sun, 20 Oct 2002 16:24:27 +0800 (CST)
Received: from jidanni by debian with local (Exim 3.35 #1 (Debian))
  id 1838lu-00019L-00
  for <grass-bugs@intevation.de>; Sun, 20 Oct 2002 13:37:06 +0800
To: grass-bugs@intevation.de
Subject: d.3d interactive more flexible than command line
From: Dan Jacobson <jidanni@dman.ddts.net>
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
Date: Sun, 13 Oct 2002 19:04:59 +0800 01:00:00 +0000 (GMT)
Message-ID: <87adlik3ac.fsf@jidanni.org>
Lines: 27
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Status: No, hits=4.0 required=5.0
  tests=DATE_IN_PAST_96_XX,RCVD_IN_ORBS,RCVD_IN_RFCI,
        SIGNATURE_SHORT_DENSE,SPAM_PHRASE_00_01,USER_AGENT
  version=2.41
X-Spam-Level: ****

-------------------------------------------- Managed by Request Tracker

On Sun, 20 Oct 2002, Request Tracker wrote:

this bug's URL: http://intevation.de/rt/webrt?serial_num=1358
-------------------------------------------------------------------------

I notice that one can manipulate a lot more of d.3d in interactive
mode than from the command line. Bummer. [GRASS 5.0.0pre1 (May 2001)]

You can do most things by manually editing a 3dview file and then loading
it from the command line. That is quite easy to do and can be automated.

By the way, too bad one must specify the coordinates of the to=, and
can't optionally give an angle instead.

That is a bit awkward. But it is easy enough to calculate a suitable
centre of view value if you know the camera location and yaw, pitch and
roll angles. Here is a MATLAB script I wrote to do it:
yl, xl, zl are the easting, northing and elevation of the camera location
yc, xc, zc are the easting, northing and elevation of the COV
(This is a left-handed co-ordinate system and the pitch angle is positive
looking downwards from the horizontal (0 when looking straight ahead))

xc=xl+10*cos(pitch)*cos(yaw);
yc=yl+10*cos(pitch)*sin(yaw);
% Pitch angle +ve downwards?
zc=zl-10*tan(pitch);
if roll < 0
  roll=(2*pi)+roll;
end
roll=roll.*(180/pi);
sprintf('TO_EASTING: %6.2f\nTO_NORTHING: %6.2f\nTO_HEIGHT: %4.2f\n', yc, xc, zc)
sprintf('FROM_EASTING: %6.2f\nFROM_NORTHING: %6.2f\nFROM_HEIGHT: %4.2f', yl, xl, zl)
sprintf('TWIST: %4.2f', roll.*10)

By experimentation I found the twist / roll angle is given in decidegrees
(!) and can be between 0 and 360 inclusive.

A quick definition in case these are given different names in geography:
yaw, pitch and roll are robotics terms; yaw is the sideways horizontal
angle from north; pitch is the vertical up/down angle from the
horizontal, and roll is the rotation of the camera along the axis that
passes through its location and the centre of view (positive clockwise).

OK, I suppose one writes scripts like 3d.view.sh.

BTW, I hope that earth's curvature is applied, as I am doing 1 degree
wide blowups of 50 km away mountains looking horizontally directly
across, in order to identify which mountains they were in family
snapshots.

At a guess I would say it probably isn't but I'm not sure. This is a very
interesting application; have you calibrated your camera for field of view
etc. or made a good estimate?

And I sure wish the cursor would stay put, each time one does a run in
interactive mode, and not jump back to the first item.

BTW, interactive mode should allow one to continue after saving a
3d.view setting.

Also Grass interactive programs should use the readline library so one
can use C-p to recall earlier entries, etc.

I think d.3d has been set in stone for 10 years; no one is going to change
it now. But it is still useful when you need to set exact observer
position co-ordinates and field of view.

In conclusion, I would like to click on a certain mountain in the
image created by d.3d to find more about it, e.g. coordinates, but
can't.

You can do this with SG3d, which runs on Silicon Graphics IRIX
workstations and is included in the GRASS IRIX pre-compiled binaries. You
can also do it in nviz (available on all OSs) but exact positioning is
harder there as it can't read 3dview files. (It can save them though, and
these can even be loaded in d.3d). I think with the latest improvements in
nviz it may be possible to set the exact viewer position but I'm not sure
how to do it yet, nor about setting the exact field of view.

--
http://jidanni.org/ Taiwan(04)25854780

"Paul" == Paul Kelly <paul-grass@stjohnspoint.co.uk> writes:

Paul> On Sun, 20 Oct 2002, Request Tracker wrote:

this bug's URL: http://intevation.de/rt/webrt?serial_num=1358
-------------------------------------------------------------------------

I notice that one can manipulate a lot more of d.3d in interactive
mode than from the command line. Bummer. [GRASS 5.0.0pre1 (May 2001)]

Paul> You can do most things by manually editing a 3dview file and then loading
Paul> it from the command line. That is quite easy to do and can be automated.

OK, I am doing that... and now I see that there is no
$ d.3d viewfile=name ...
provided, so, if I want to use a Makefile, I must do some complex
echo -e xxx\\nxxx\\n etc stuff to fool it into thinking I'm entering
it from the keyboard or something.

And the fields in the 3dview seem undocumented for the beginner.

Anyway, e.g. "resolution" cannot be controlled from the 3dview file,
only the interactive command. Hmm, run g.region from Makefile... ok.

"Line Frequency" should be called infrequency...

Anyway, if I wanted to make a presentation, controlled by a makefile,
I would still have to walk over to the keyboard to especially interact
with d.3d .

Also, let's say I am editing the 3dview file as you suggest, and now I
hit emacs' M-x compile command ... well, how will I get it displayed
after each minor change? I suppose the echo stuff above is the only
way to get d.3d to reread the file as it only reads once per session.

Anyway, this points to a bill of rights for grass programs: everything
you intend to ask for with "parser", you better have a way of
specifying on the command line, or else == bug!
--
http://jidanni.org/ Taiwan(04)25854780

"P" == Paul Kelly <paul-grass@stjohnspoint.co.uk> writes:

P> You can do most things by manually editing a 3dview file and then loading
P> it from the command line. That is quite easy to do and can be automated.

I assume we are talking about e.g. PERMANENT/3d.view/xiugu . OK, I
edited it, but I am convinced that your proposal of loading it from
the command line is not documented, at least not on man d.3d.

The best one can do is start d.3d interactively then give the filename
on the third question.

If one could load it from the command line, then rapid prototyping
could be possible, etc.
--
http://jidanni.org/ Taiwan(04)25854780