Tue, 08/11/2020 - 11:03
Forums:
Hello everyone, I found that when the camera is set to Projection_Perspective, ais_viewcube becomes strange, but when Projection_Orthographic, ais_viewcube is normal. I don't know how to modify it? Thank you all.
switch (projectionType) {
case PROJECTION_TYPE_ORTHOGONAL: {
myView->Camera()->SetProjectionType(Graphic3d_Camera::Projection_Orthographic);
}
break;
case PROJECTION_TYPE_PERSPECTIVE: {
myView->Camera()->SetProjectionType(Graphic3d_Camera::Projection_Perspective);
}
break;
}
Tue, 08/11/2020 - 11:59
I suppose what you've called "becomes strange" is a perspective projection distortions, which are expected when you enable perspective projection (you may see on screenshots that View Cube has similar distortions as a Grid).
Distortions grow closer to view boundaries, so that one option is moving View Cube farther from boundaries or to recude Field of View camera parameter.
Tue, 08/11/2020 - 22:54
Ok. Thank you so much. I created this AIS_VIEWCUBE through Graphic3d_TransModeFlags, so I think its display effect should not be affected by the lights and cameras in the 3D scene, but it is not. I should have understood it wrong.
I guess that the default camera FOV of 3dsmax should be relatively small, so its ViewCube has no distortion in perspective and orthogonal projection modes.
Thank you again. It's been a long time since I saw you. Can you help me look at these questions again?
https://www.opencascade.com/content/brepoffsetapimakeoffset-wire-and-face-odd-occt-740
https://www.opencascade.com/content/occt-740-doubts-about-using-ocaf
https://www.opencascade.com/content/use-face-split-solid-how-exactly-retrieve-left-or-right-splitted-solid
https://www.opencascade.com/content/approxcurve3d-convert-wire-geombsplinecurve
https://www.opencascade.com/content/project-curve-surface-and-divide-surface-two-parts
https://www.opencascade.com/content/brepoffsetapimakepipeshell-bspline-error
Excuse me again, thank you。
Fri, 08/14/2020 - 09:38
Please don't bloat topics with unrelated questions and references - this messes up a forum structure.
If you have asked some question long time ago and have not received an answer, consider to:
If it does not - edit topic head (probably adding some comments like "last edited on _" if forum engine doesn't put this automatically).
Something like "Ping. Problem is still not resolved and I would appreciate any feedback".
Don't abuse this too much (don't "ping" topics massively or too regularly).
This will show your good attend to the problem resolution and will stimulate others to help you (counter to the topic like "please solve my problem, I have no idea what to do").
Try helping other users, when you can.
Answering others question might require specific expertise (there is no person knowing an every single algorithm in OCCT framework), time and motivation to help (see previous points).
This is not a service - you may receive more reliable help by attending to support services.
This is my personal opinion on how forums are supposed to work. It is not a golden bullet to receive a help, but it might help ;).
Thu, 08/13/2020 - 10:33
Transform persistence in OCCT tries to fit object into 3D world space while preserving some aspects (size, orientation, position on the screen, etc.).
In particular, it does not affect projection matrix at all; it may affect only camera orientation matrix, as you can see in Graphic3d_TransformPers::Apply() implementation.
It doesn't mean, however, that other systems implement viewcube-alike presentations in the same way - they may decide to draw them using orthogonal projection matrix or in some other way.
Sat, 04/09/2022 - 05:14
Hi Kirill,
I'm new to this community. Unfortunately, from the link you provided, I still do not figure out how to set the matrix accordingly.
I have the same issue after "view->Camera()->SetProjectionType(Graphic3d_Camera::Projection_Perspective);".
How can I apply such a change to my AIS_ViewCube?
Thanks.
Fri, 08/14/2020 - 01:06
Thank you very much for the "using orthogonal projection matrix" you mentioned, it is very useful.
Sorry to messes up a forum structure. I am a little worried. I will try to do this.
Thank you again.