Fabian,

I won't be able to take a look at this for a couple of hours.

But I think I understand what you are trying to do.

I will get back to you.
Miguel

> Miguel,
>
> I try to implement the rotational stuff we discussed previously but I
> get some problems.
> The purpose is to rotate around an axis defined by "axisAngle" and
> passing through the point "point" (see code below). The rotation angle
> is included in "axisAngle". The basic idea in the code is to translate
> the molecule so that the center of rotation moves to 0,0 (screen
> coordinate), then do the rotation and translate again by the opposite
> amount of the previous rotation. The scheme in code below works as long
> as I don't rotate with the mouse. If I begin to rotate with the mouse
> then further call to rotate(...) doesn't behave as expected. Actually,
> as I expect; probably because I don't understand very good what is
> returned by getViewTransformMatrix(). I guess you will immediately see
> what's going wrong in my code (I put translations in matrixRotate which
> is probably not good).
>
> Thankx
>
> in DisplayPanel.java:
>
> public void rotate(Vector3f point, AxisAngle4f axisAngle) {
>     Matrix4f matrix = new Matrix4f();
>     Vector3f center = new Vector3f(chemframe.getCenter());
>     point.negate();
>     point.add(center);
>     matrix.setIdentity();
>     matrix.set(point);  //translation
>     matrixRotate.mul(matrix, matrixRotate);
>     matrix.setIdentity();
>     matrix.setRotation(axisAngle); //rotation
>     matrixRotate.mul(matrix, matrixRotate);
>     point.negate();
>     matrix.setIdentity();
>     matrix.set(point); //translation
>     matrixRotate.mul(matrix,matrixRotate);
>
>     repaint();
>   }
>
> Fabian
> --
> Fabian Dortu <[EMAIL PROTECTED]>


--------------------------------------------------
Miguel Howard                   [EMAIL PROTECTED]
c/Pe�a Primera 11-13 esc dcha 6B
37002 Salamanca
Espa�a Spain
--------------------------------------------------
telefono casa 923 27 10 82 movil 650 52 54 58
--------------------------------------------------
To call from the US dial    9:00 am Pacific US   =
home 011 34 923 271 082    12:00 noon Eastern US =
cell 011 34 650 525 458     6:00 pm Spain
--------------------------------------------------




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to