[X3D-Public] [Source] computing an SFRotation from 2 points?

Herbert Stocker herbert.stocker at bitmanagement.de
Thu Jun 25 02:13:05 PDT 2009

Don, i made a tutorial about rotations and aiming the camera at a 
certain point.
It's at http://www.hersto.net/Tutorials/Rotations3D.php?lay=2
Scroll down towards "Orienting a Camera Towards an Object" and there is 
script code
for what you want to do. It's old-style VrmlScript, but should run as 
SAI EcmaScript,

BTW, would it be possible/desirable to link this tutorial and the others 
i did from the tutorials
page of the Web3D site (http://www.web3d.org/x3d/learn/tutorial/ )?


Don Brutzman wrote:
> newbie question:  want to compute an SFRotation orientation from
> 2 SFVec3f point locations using Java.
> fyi this will be used in X3D-Edit as an authoring assist, to compute
> the desired Viewpoint orientation (relative to -z axis default view)
> that aims the Viewpoint from defined position towards a look-at point.
> prefer to use X3D SAI for Java if possible.  however i am not finding any
> utility functions in the spec:
> http://www.web3d.org/x3d/specifications/ISO-IEC-19777-2-X3DLanguageBindings-Java/Part2/X3D_Java.html 
> however the X3D SAI for ECMAScript does have such a utility method:
> Table 7.18 — SFRotation instance creation functions
>     SFRotation      (SFVec3f fromVector, SFVec3f toVector)
>     fromVector and toVector are normalized and the rotation value
>     that would rotate from the fromVector to the toVector is stored
>     in the object.
> http://www.web3d.org/x3d/specifications/ISO-IEC-19777-1-X3DLanguageBindings-ECMAScript/Part1/functions.html#t-SFRotationInstanceCreationFunctions 
> thanks in advance for pointers or any example code, either using
> Java SAI or simply some other exemplar Java source.
> all the best, Don



Bitmanagement Software GmbH

  Herbert Stocker
  Dipl.-Ing. Univ.

Tel:      +49 (0) 8151 971708
Fax:      +49 (0) 8151 971709
E-Mail:   herbert.stocker at bitmanagement.de


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!

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20090625/b3660a94/attachment.html>

More information about the X3D-Public mailing list