<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=windows-1252"
 http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Don, i made a tutorial about rotations and aiming the camera at a
certain point.<br>
It's at <a class="moz-txt-link-freetext" href="http://www.hersto.net/Tutorials/Rotations3D.php?lay=2">http://www.hersto.net/Tutorials/Rotations3D.php?lay=2</a><br>
Scroll down towards "<a>Orienting a Camera Towards an Object" and there
is script code<br>
for what you want to do. It's old-style VrmlScript, but should run as
SAI EcmaScript,<br>
too.<br>
<br>
BTW, would it be possible/desirable to link this tutorial and the
others i did from the tutorials<br>
page of the Web3D site </a><a>(http://www.web3d.org/x3d/learn/tutorial/
)</a><a>? <br>
<br>
<i>Herbert<br>
<br>
<br>
</i></a><br>
Don Brutzman wrote:
<blockquote cite="mid:4A42795F.7030104@nps.navy.mil" type="cite">newbie
question:  want to compute an SFRotation orientation from
  <br>
2 SFVec3f point locations using Java.
  <br>
  <br>
fyi this will be used in X3D-Edit as an authoring assist, to compute
  <br>
the desired Viewpoint orientation (relative to -z axis default view)
  <br>
that aims the Viewpoint from defined position towards a look-at point.
  <br>
  <br>
prefer to use X3D SAI for Java if possible.  however i am not finding
any
  <br>
utility functions in the spec:
  <br>
<a class="moz-txt-link-freetext" href="http://www.web3d.org/x3d/specifications/ISO-IEC-19777-2-X3DLanguageBindings-Java/Part2/X3D_Java.html">http://www.web3d.org/x3d/specifications/ISO-IEC-19777-2-X3DLanguageBindings-Java/Part2/X3D_Java.html</a>
  <br>
  <br>
however the X3D SAI for ECMAScript does have such a utility method:
  <br>
Table 7.18 — SFRotation instance creation functions
  <br>
    SFRotation      (SFVec3f fromVector, SFVec3f toVector)
  <br>
    fromVector and toVector are normalized and the rotation value
  <br>
    that would rotate from the fromVector to the toVector is stored
  <br>
    in the object.
  <br>
<a class="moz-txt-link-freetext" href="http://www.web3d.org/x3d/specifications/ISO-IEC-19777-1-X3DLanguageBindings-ECMAScript/Part1/functions.html#t-SFRotationInstanceCreationFunctions">http://www.web3d.org/x3d/specifications/ISO-IEC-19777-1-X3DLanguageBindings-ECMAScript/Part1/functions.html#t-SFRotationInstanceCreationFunctions</a>
  <br>
  <br>
thanks in advance for pointers or any example code, either using
  <br>
Java SAI or simply some other exemplar Java source.
  <br>
  <br>
all the best, Don
  <br>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<table border="0">
  <tbody>
    <tr>
      <td style="width: 25em;">
      <pre>_________________________________________________________

Bitmanagement Software GmbH
<a class="moz-txt-link-freetext" href="http://www.bitmanagement.de">http://www.bitmanagement.de</a>

  Herbert Stocker
  Dipl.-Ing. Univ.
  Entwicklung/Engineering

Tel:      +49 (0) 8151 971708
Fax:      +49 (0) 8151 971709
E-Mail:   <a class="moz-txt-link-abbreviated" href="mailto:herbert.stocker@bitmanagement.de">herbert.stocker@bitmanagement.de</a>
_________________________________________________________
      </pre>
      <p
 style="font-family: arial; font-size: 0.8em; text-align: justify; color: rgb(128, 128, 128);">
VERTRAULICHE INFORMATIONEN! CONFIDENTIAL!
      </p>
      <p
 style="font-family: arial; font-size: 0.8em; text-align: justify; color: rgb(128, 128, 128);">Diese
Email enthält vertrauliche Informationen und ist
nur für den berechtigten Empfänger bestimmt. Wenn diese
Email nicht für Sie bestimmt ist, bitten wir Sie, diese
Email an uns zurückzusenden und anschließend auf Ihrem
Computer und Mail-Server zu löschen. Solche Emails und
Anlagen dürfen Sie weder nutzen, noch verarbeiten oder
Dritten zugänglich machen, gleich in welcher Form. Wir
danken für Ihre Kooperation!
      </p>
      <p
 style="font-family: arial; font-size: 0.8em; text-align: justify; color: rgb(128, 128, 128);">This
email contains confidential information and is
intended for the authorised recipient only. If you are
not an authorised recipient, please return the email to
us and then delete it from your computer and mail
server. You may neither use nor edit any such emails
including attachments, nor make them accessible to third
parties in any manner whatsoever. Thank you for your
cooperation.
      </p>
      </td>
    </tr>
  </tbody>
</table>
</div>
</body>
</html>