Thu, 04/13/2017 - 23:43
I would like to use OCCT with the Unreal Engine (or possibly similar Cpp-based engines). Would anyone have any advice on how this could be accomplished given that these engines have their own scene graphs and rendering pipelines? Is there a low level in OCCT where one could hope to do a reasonably high performance conversion to the engine's low-level format? If OCCT is not suitable for this kind of integration, are there any suggestions for other geometry kernels which would be?
TIA for any enlightenment,
Fri, 04/14/2017 - 10:21
Integration of two engines have the following kind of issues:
Different libraries are also possible, but very tricky.
To interleave 3D objects in the same view, the projection matrices should be the same.
Modern engines implements multi-pass rendering engines, including OCCT 3D viewer.
If application needs to insert custom low-level rendering code - it is more or less straightforward for OCCT 3D Viewer;
but combining two independent engines both using with multi-pass techniques might be too tricky.
You have to know how rendering works in both engines.
Effects like shadows, reflections and others will not work correctly for objects existing in different engines,
because such effects require information about entire geometry.
OCCT 3D viewer is based on OpenGL or OpenGL ES - this is first thing you should worry when checking that to renderers could co-exist.
Combining Direct3D with OpenGL is also possible (OCCT provides sample for integrating OpenGL-based 3D viewer into WPF application through WGL_NV_DX_interop extension, since WPF supports only Direct3D 9 surface), however this way comes with extra problems and compatibility issues, and OCCT 3D Viewer can also use OpenGL ES on Windows through Angle project - working on top of Direct3D.
So, integrating OCCT 3D Viewer into another renderer is technically possible - example is integrating OCCT 3D Viewer into QtQuick (Qt/QML) application, where Qt is used for rendering user interface on top of 3D Viewer (see CAD Assistant), the oppissite is also possible - OCCT 3D Viewer provides interfaces for embedding low-level rendering commands. However for such combination another rendering engine should support such kind of co-existing.
Of course, you can also use OCCT only as modeling kernel - so that OCCT will generate model and prepare triangulation but visualization will be performed by preferred 3D rendering engine.
Fri, 05/19/2017 - 14:05
I have made an webgl 3D viewer based on threejs, to show opencascade topods objects in the browser.
Here are some examples:
Make a bottle
Normal of faces
You could do the same for showing TopoDS object on a different view.
Best regards, Guido
Mon, 03/11/2019 - 00:31
I have been looking at using OCCT for modeling only. I have a couple of questions though:
Thanks a lot!
Mon, 03/11/2019 - 01:57
Retrieving triangles is more or less straightforward - I think this forum contains some code snippets on this topic.
I would say that using StdPrs facilities would be the best option in case if look-n-feel of Wireframe (StdPrs_WFShape, StdPrs_Isolines) and Shaded (StdPrs_ShadedShape) presentations of OCCT 3D Viewer is what you are looking for, but it might be tricky using them outside without copy-paste.
Actually low-level Selection logic is implemented independently from visualization in OCCT, so that it can be reused for another viewer, although indeed, it is not trivial. IVtk component is an example of such synergy of OCCT selection (SelectMgr_ViewerSelector) and VTK visualization.