- Timestamp:
- Feb 18, 2009, 10:59:48 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/OpenInventor/src/SoGL2PSAction.cc
r929 r930 33 33 /*--------------------------------------------------------------------------*/ 34 34 35 #define G4DEBUG_VIS_OGL 135 //#define G4DEBUG_VIS_OGL 1 36 36 37 37 // this : … … 172 172 } 173 173 174 void SoGL2PSAction::DrawXYPolygon175 (G4double size,176 const G4Point3D& centre,177 const G4VisAttributes* pApplicableVisAtts)178 {179 G4int nSides;180 G4double startPhi;181 nSides = GetNoOfSides(pApplicableVisAtts);182 startPhi = 0.;183 184 const G4Vector3D& viewpointDirection =185 fpViewer -> GetViewParameters().GetViewpointDirection();186 const G4Vector3D& up = fpViewer->GetViewParameters().GetUpVector();187 const G4double dPhi = twopi / nSides;188 const G4double radius = size / 2.;189 G4Vector3D start = radius * (up.cross(viewpointDirection)).unit();190 G4double phi;191 G4int i;192 193 glBegin (GL_POLYGON);194 for (i = 0, phi = startPhi; i < nSides; i++, phi += dPhi) {195 G4Vector3D r = start; r.rotate(phi, viewpointDirection);196 G4Vector3D p = centre + r;197 glVertex3d (p.x(), p.y(), p.z());198 }199 glEnd ();200 }201 174 202 175 #endif
Note: See TracChangeset
for help on using the changeset viewer.