To programmatically create a “Fit visible” camera, you will compute its value using the model bounding box. In this sample code below you can see a simple way to compute a fit world view
“Default” camera
A3DMiscComputeBoundingBox
will compute a Bounding Box for the model.Then we compute the center of the bounding box. It will be the camera center.
Finally we make a position for the camera. Here I computed a vector from the center position, but you may adjust the values to find the best fitting for your usage.
We use the camera in the HOOPS Publish sample UserDefinedViews.
...
language | cpp |
---|
...
View the sample code in our forum post.
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Page Properties | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
|