Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java3D: Problem  RSS feed

 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I am fairly new to Java3D and trying to create a program to visualize molecules. currently i am facing problem with rendering all sort of molecules with same size.

I have a file with information such as Atoms and bonds in molecule and which bond is in between which all atoms.

simple Molecule file looks like this.

-1.1562 -0.7537 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
-1.8707 -0.3412 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.8707 0.4838 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.4418 0.4838 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.4418 -0.3412 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
1 5 1 0 0 0 0
2 3 2 0 0 0 0
3 4 1 0 0 0 0
4 5 2 0 0 0 0

where the first 5 lines denotes all the atoms. with information such as :
-1.1562 is the xCord where atoms is to be placed and -0.7537 is y-cord and 0.0000 is the z-cord respectively.

the second table blockl defines the bond between atoms like
1 2 1 refers to there is a single bond between atom 1 and 2 which are first and second atom lines in above table.

Problem: When i draw these atoms and bonds betwen them , i want to apply an algo, where all the x,y ,z cords gets shifted to a normal view and appears in a specific size.

if the cord of an aotm is simple enough say -1.0000 to +1.0000, it renders properly but if cords are like -13.0000 to 69.00000 it created problem and when i center the complete molecule, the image becomes very small.

any clues or suggestions:
The main Problem is to shift all the atom cordinates such that, the viewing of the molecule remains constant, and then user can zoom, rotate or translate.


regards
Akhil
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!