Changeset 1335 for trunk/source/visualization/OpenGL/src
- Timestamp:
- Sep 28, 2010, 4:03:23 PM (15 years ago)
- Location:
- trunk/source/visualization/OpenGL/src
- Files:
-
- 2 edited
-
G4OpenGLQtViewer.cc (modified) (1 diff)
-
G4OpenGLViewer.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r1333 r1335 982 982 G4cout << G4endl; 983 983 G4cout << "========= Misc =========" << G4endl; 984 G4cout << "Press ALT +/- to slow/speed autorotation/move" << G4endl;984 G4cout << "Press ALT +/- to slow/speed rotation/move" << G4endl; 985 985 G4cout << "Press H to reset view" << G4endl; 986 986 G4cout << "Press Esc to exit FullScreen" << G4endl; -
trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc
r1332 r1335 931 931 G4Vector3D zprime; 932 932 933 G4double delta_alpha;934 G4double delta_theta;935 936 933 G4Vector3D new_vp; 937 934 G4Vector3D new_up; 938 939 G4double cosalpha;940 G4double sinalpha;941 935 942 936 G4Vector3D a1; … … 948 942 //phi spin stuff here 949 943 950 951 944 #ifdef G4DEBUG_VIS_OGL 952 945 printf("G4OpenGLViewer::rotateScene dx:%f dy:%f delta:%f\n",dx,dy, deltaRotation); … … 955 948 vp = fVP.GetViewpointDirection ().unit(); 956 949 up = fVP.GetUpVector ().unit(); 957 958 959 950 960 951 G4Vector3D zPrimeVector = G4Vector3D(up.y()*vp.z()-up.z()*vp.y(), 961 952 up.z()*vp.x()-up.x()*vp.z(), 962 953 up.x()*vp.y()-up.y()*vp.x()); 963 G4long zPrimeVectorX = up.y()*vp.z()-up.z()*vp.y();964 G4long zPrimeVectorY = up.z()*vp.x()-up.x()*vp.z();965 G4long zPrimeVectorZ = up.x()*vp.y()-up.y()*vp.x();966 954 967 955 viewPoint = vp/deltaRotation + (zPrimeVector*dx - up*dy) ; … … 970 958 viewPoint.x()*zPrimeVector.y()-viewPoint.y()*zPrimeVector.x()); 971 959 972 G4long new_upLenLong = sqrt((G4long)new_up.x()*(G4long)new_up.x()+(G4long)new_up.y()*(G4long)new_up.y()+(G4long)new_up.z()*(G4long)new_up.z());973 // new_up = new_up/new_upLenLong;974 // G4double new_upLenDouble = new_up.x()*new_up.x()+new_up.y()*new_up.y()+new_up.z()*new_up.z();975 976 G4Vector3D new_upDiv = G4Vector3D((G4double)(new_up.x()/new_upLenLong),977 (G4double)(new_up.y()/new_upLenLong),978 (G4double)(new_up.z()/new_upLenLong));979 980 G4Vector3D new_upPrec = G4Vector3D(((G4double)(((G4long)viewPoint.y()*(G4long)zPrimeVector.z()981 -(G4long)viewPoint.z()*(G4long)zPrimeVector.y())/new_upLenLong)),982 ((G4double)(((G4long)viewPoint.z()*(G4long)zPrimeVector.x()983 -(G4long)viewPoint.x()*(G4long)zPrimeVector.z())/new_upLenLong)),984 ((G4double)(((G4long)viewPoint.x()*(G4long)zPrimeVector.y()985 -(G4long)viewPoint.y()*(G4long)zPrimeVector.x())/new_upLenLong)));986 960 G4Vector3D new_upUnit = new_up.unit(); 987 961 988 962 989 #ifdef G4DEBUG_VIS_OGL990 printf("G4OpenGLViewer::rotateScene up: %.10lf %.10lf %.10lf len:%.10lf lenLong:%.10lf %f\n",up.x(),up.y(),up.z(), up.mag(),new_upLenLong,new_upLenLong);991 printf("G4OpenGLViewer::rotateScene NEW new up UNIT / %.10lf %.10lf %.10lf\n",new_upUnit.x(),new_upUnit.y(),new_upUnit.z());992 printf("G4OpenGLViewer::rotateScene NEW new up Prec: %.10lf %.10lf %.10lf\n",new_upPrec.x(),(viewPoint.z()*zPrimeVectorX-viewPoint.x()*zPrimeVectorZ),new_upPrec.z());993 printf("G4OpenGLViewer::rotateScene NEW new up Div: %.10lf %.10lf %.10lf\n",new_upDiv.x(),new_upDiv.y(),new_upDiv.z());994 printf("G4OpenGLViewer::rotateScene vp: %f %f %f\n",vp.x(),vp.y(),vp.z());995 996 viewPoint = viewPoint*deltaRotation;997 998 printf("G4OpenGLViewer::rotateScene NEW --new vp: %f %f %f\n",viewPoint.x(),viewPoint.y(),viewPoint.z());999 #endif1000 963 1001 964 fVP.SetUpVector(new_upUnit);
Note:
See TracChangeset
for help on using the changeset viewer.
