> > Below are some thoughts and observations: > > Fundamentally, I think your code is correct. > > I am still struggling to understand some of the matrix transformation > processes. The code in getViewTransformMatrix() is essentially the same > code that was there before. As I was trying to figure out how the code > worked I made the variable names longer so that they would make more sense > to me. > > > (I put translations in matrixRotate which > > is probably not good). > I am not sure why matrixRotate and matrixTranslate are separate. I think > they could be merged together. But I was afraid to take that step right > now. > If I recall, in the current implementation the units of matrixTranslate > are in screen pixels. If we were to merge them I think we would want to > convert to angstroms before we merged with matrixRotation. (But right now > it is hurting my head to think about it :-) > > The reason I started working on this code was to fix a bug ... which I > still have not fixed. But once I started changing the variable names I > decided I should figure out how it works. > > I added several versions of rotate(...) at the bottom of > DisplayPanel.java. I included one for an AngleAxis4f rotation. > > I added 4 test menu items under the view menu. They are currently tied to > rotateX(45) rotateY(45) rotateZ(45) and an AngleAxis rotation of 45 > degrees about the 1,1,1 vector. Search for "test1" ... "test4" in the code > and you will find it. During testing you can change these items to do > whatever you want. > > I think a good molecule to test out these rotations is samples/bulk_Si.in > > The more I worked on this, the more I realized what you are trying to do. > It is probably the case that you want to do this rotation while keeping > the molecule in the center of the screen. If that is the case, then it is > going to require a little more thought.
No, I don't think the molecule should stay in the center of the screen.
It would give a weird result as translations will be mixed with
rotations. But a new button to recenter the molecule would be nice.
>
> I may be mistaken, but my current thinking is that, in the general case,
> it isn't possible to accomplish that unless we set up a pipeline of
> transformations to apply. But if you only want to do one AngleAxis
> rotation about a point then we could build it into the transform process.
Actually there is now an easy way to do it:
void rotate(Point3f center, AxisAngle4f axisAngle) {
oldcenter = center;
setCenter(center);
rotate(axisAngle);
repaint();
setCenter(oldCenter);
}
But this gives another problem: it seems that setCenter(oldCenter) is
executed *before* repaint() (if I remove setCenter(oldCenter), it works
but the center of rotation is modified permanantly).
This problem is related to our famous bug, isn't it? Data is modified
while the paint() method is executed. I tried to synchronize the method
with a lock variable but all I get is a freezing display.
So I think that displayPanel should be redesigned using Runnable and
Synchronized (no data modification allowed when repainting). I tried to
do that this afternoon but I am not competent enough ;-). If you want to
dive into it, this site may be interesting:
http://www.javaworld.com/javaworld/jw-10-1998/jw-10-assure.html.
Good luck!
>
> In the process of working on this I wondered if it would be useful to have
> an option to display the X, Y, and Z axes on the screen. Do you think that
> would be useful? I don't think it would be too difficult to build ...
> although I have some concern that getting the paint process z-ordering
> correct may be a challenge.
Yes, I think it's usefull and quite easy to do. I will do it.
z-ordering is probably impossible to handle correclty with our pseudo
3D.
>
> I will need to split DisplayPanel.java into two pieces. There is too much
> code in there and too much of it has to be cloned for the applet. But I'm
> not ready to do that yet.
Great occasion to "threadize" it ;-)
>
> I have already done some work on a more comprehensive rasmol/chime script
> interpreter. That will expose quite a bit of functionality in the area of
> rotations and will allow for fine gradations of
> rotations/translations/scaling.
>
> Can you tell me a little more about the level of "fine rotation" you want?
>
> What kind of UI gestures do you want to accomplish this? Do you want a
> "fine mouse movements" mode?
By "fine" I simply means "using numerical values". I have already
started to work on an interface.
>
> What is the UI you want to use to specify the point and the axis?
>
> Can you give me a brief description of the application and what you are
> trying to accomplish?
There will be
-a text field (where the user can directly enter the numerical values)
to enter the center of rotation *and* a button "pick atoms" (user picks
atoms and the average coordinates is set into the textfield).
-a text field to enter the axis direction and a button to pick 2 atoms
defining the direction.
-a text field for the angle.
-eventually, text fields for translation and scaling.
Fabian
>
> �Adi�s!
> Miguel
>
>
>
>
>
> -------------------------------------------------------
> 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
--
Fabian Dortu <[EMAIL PROTECTED]>
signature.asc
Description: This is a digitally signed message part
