> On Jul 24, 2006, at 3:37 PM, Miguel wrote: >> I suggest that if you want to add this to Jmol 10 that it may be >> easier to >> add a separate 'interpolate' step that actually calculates and >> stores the >> intermediate positions of the atoms. > > Would you ming elaborating a bit on this?
As I recall, one of the problems with 'interpolation' in Jmol v9 animations was that the locations of the atoms were not actually calculated and stored. Rather, the locations of the atoms were dynamically calculated as each frame was drawn. At the time I thought that this was too complicated ... because it meant that the code to calculate the position in real-world Angstrom coordinates was comingled with the code to transform into screen coordinates AND, to a certain extent, the code for rendering. Additionally, the code needed to know a lot about the 'model' representation, since the interpolation took place between two models. In order to reduce this complexity I think it would be better to break this up into pieces. I thought about something like a separate 'interpolate <n>' command where <n> was the number of steps to introduce between existing models. I was thinking that it would actually introduce new models. That way the interpolation code could focus on interpolation, and not have to worry about screen transformation issues. The biggest problem that I see with this approach is that you would be inserting new models between existing models. That would require some rework of the model/frame code. So, as I am writing this it occurs to me that maybe the other approach isn't so bad. As an example of how this would work, you can take a look at the vibration code. That code dynamically applies the vector to adjust the atom position immediately before the transformation. It works well for the vibrations because the location of each atom is transformed individually. If you wanted to apply this to animations, then I think that you would want for the atom in frame <n> to be used from frame <n - 0.5> to frame <n + 0.5>, where I am using a fractional frame value to represent an interpolated value. At the beginning it would be easiest to use linear interpolation between the two frames ... so the location of an atom at frame 1.25 would be the location at frame 1 + 0.25 * vector from frame 1 to frame 2. If you could structure it this way, I think it would be best if a the interpolation routine was written to take 4 atom positions ... to interpolate between atoms n & n+1 you would also pass in frames n-1 and n+2. This would allow a smoother cubic spline interpolation that would give better results. Even if you don't implement this at the beginning, try to structure the code this way so that the parameters will be available in the future. Some other problems that always bugged me related to interpolating animations between frames ... - you will need to interpolate atom sizes as well - you may need to interpolate atom colors as well - it isn't clear to me how other atom characteristics should be handled I think that these things may also have pushed me towards the separate 'interpolate' command ... because these issues potentially introduce a lot of complexity that would be hard to handle as part of the rendering cycle. I realize that my comments may still be too hard to understand. Give some thought to the problem and please feel free to ask specific questions. Miguel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users