Hello!
I have here -> http://88.192.212.114
My Java2D engine for my AWT 3D games, this is what im asking now.
My AWT 3D engine for my site, is almost done, but, i now need some tiny help with one funktion,
the funktion where i need this help is “AWT.lookAt( Point3D p3a, Point3D p3b );”
I currently have the following code to do rotation to certain Point3D(x,y,z);
if ( JC.keys[KeyEvent.VK_L])
{
double xa = JMath.calcAngle ( new Point ( (int)AWT.eye_ypos, (int)AWT.eye_zpos), new Point(0,0) );
double ya = JMath.calcAngle ( new Point ( (int)AWT.eye_xpos, (int)AWT.eye_zpos), new Point(0,0) );
double za = JMath.calcAngle ( new Point ( (int)AWT.eye_xpos, (int)AWT.eye_ypos), new Point(0,0) );
AWT.rotate3DTo ( xa , ya , za );
}
eye_(xyz)pos is the location of camera, and the camera is looking to the Point3D (0,0,0);
The rotate3DTo ( xa,ya,za); rotates camera to look to selected angles.
When running code, I have success on y angle and some with x angle but when i change eye_zpos, then the look wont give right angles anymore.
I have tryed to look google and i have found several tutorials, but, they have been too difficult for me to follow.
Maybe some of here have some old lookAt tutorial on storage to help me !
//----
Thanks,