Mihai Bujanca
Mihai Bujanca

Reputation: 4219

Tetrahedron Java3d

As describes the Methane image, I need to make a Tetrahedron in Java3d with the angles between any two bounds to be 109 deg (H are bounded with C, so the lines are the bounds).
I must admit that I don't quite have any idea about how should I do it. I tried it that way: one bound with rotX and rotZ at 0 deg both. The one rotX at 109 deg. The next step would be rotZ and rotX at 109 deg. Let's say that angle for rotX is AngleX and the angle for rotZ is AngleZ. The end of my cylinder will be (calculated and tried) at (sin AngleZ,cos AngleZ*cos AngleX, cos AngleZ*sin AngleX). This is legit, so ouviously rotating again would do no good.

I have 4 cylinders of 2f length, created one at a time, translated at (0,1,0) so their end is at (0,0,0). From this point, I rotate my cylinders around the point (0,0,0) and I try to achieve a tetrahedron. The left cylinder is at {109,0} and the right one at {109,109} Can be easily seen that it's not the same angle between the left cylinder and the one going up and the right one and the cylinder going upimage for bounds at angles {0,0}, {109.5,0},{109.5,109,5} (mouserotated so you can see better)

Also I have to say that solving this by calculus won't help me too much, because I will probably need to change angles in some situation, but I still need it to have same angles between cylinders.

Any ideas? How should I solve this?

Note: To be easier, I transformed from radians to degrees in my program so I work with degrees.

Upvotes: 1

Views: 474

Answers (1)

Patricia Shanahan
Patricia Shanahan

Reputation: 26185

I think you may be making this a bit more complicated than it needs to be. Isn't methane symmetrical? If so, put the hydrogen atoms at non-adjacent vertices of a cube, and the carbon at the center of the cube.

To see what I mean do a Google search for "methane symmetry" and look at the images.

If you need a non-symmetrical variant, I would still calculate the locations of the atoms outside your program, or using non-graphical code, and only use java-3d to place them.

Upvotes: 3

Related Questions