| Summary: | RayTracerX not responding to /vis/viewer/set/upVector commands | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | jasondet |
| Component: | visualization/RayTracer | Assignee: | John.Allison |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P5 | ||
| Version: | 9.4 | ||
| Hardware: | Apple | ||
| OS: | Mac OS X | ||
| Attachments: |
Edits to G4RayTracerViewer.cc to fix the reported bug
Edits to G4TheRayTracer.cc to fix the reported bug Edits to G4TheRayTracer.hh to fix the reported bug |
||
|
Description
jasondet
2011-12-27 20:19:20 CET
Created attachment 146 [details]
Edits to G4RayTracerViewer.cc to fix the reported bug
Created attachment 147 [details]
Edits to G4TheRayTracer.cc to fix the reported bug
Created attachment 148 [details]
Edits to G4TheRayTracer.hh to fix the reported bug
I was able to find the part of the RayTracer code where all of these calculations are done, and I think I was able to make the edits myself. The attached files, based on their G4.9.5 versions, contain the required edits. To summarize: - Don't override the user's head angle setting in G4RayTracerViewer::SetView() - New data member "G4ThreeVector up;" added to G4TheRayTracer, along with a Setter and a Getter. - Send the user-specified upVector to G4TheRayTracer in G4RayTracerViewer::SetView() - In G4TheRayTracer::CreateBitMap(): - Rotate rayDirection so that the upVector projection in the jpeg plane is parallel to the jpeg's vertical direction. - Use headAngle to allow for a user-specified rotation away from the upVector. headAngle's default value was changed to 0. The code works for me in all 8 octants and for all the special cases I tried (e.g. viewpoint theta = 0 or theta = 180 deg). As for the other visualizations, the orientation is not well defined when the upVector is parallel to the viewing direction. Also, I made sure that the geometry's positive x axis points to the right and the positive y axis points up when you are looking from positive z (viewpoint theta,phi = 0,0) as I understand the convention to be. Thanks, Jason. Finally got around to looking at this. Really appreciate your investigation and an actual proposal for fixing the problem. We are very happy to incorporate your fixes. We have installed them and tested them and they will be in the next patch, if any, and certainly in the next release. Also, appreciate your comments about the User Guides. We will add something for the next release. |