Hello, the height of orthographic camera I got from SUCameraGetOrthographicFrustumHeight() seems much smaller than the real one.
This is the original view in SketchUp(model unit:mm). The height is about 600000mm.
This is the view I restored in my own rendering engine using the camera parameters from SUCameraRef of the scene. The height I got is 23651.724698546866.
This is the parameters I got.
Is there anything else I need to do? Thank you.
nmason
June 7, 2024, 10:33am
2
seems related to units maybe?
600000 mm = about 23600 inches
Agreed . All SketchUp API model dimensions and vertex coordinates are in inches .
You are not the first to think that the entire world uses metric system values.
This is why I reported the following documentation issue in NOV of 2020 .
opened 05:13PM - 10 Nov 20 UTC
C API
SketchUp
documentation
#### SketchUp C API Documentation Issue
ISSUE: The C API does not indicate … anywhere that SketchUp internal geometric values (and those stored in **.skp** and **.layout** file formats,) for **length**, **area** and **volume** are in **inches**.
This causes problems for C API users unfamiliar with SketchUp and/or it's Ruby API.
REF Public forum thread: [Reading Drawing Scale (or Units)](https://forums.sketchup.com/t/reading-drawing-scale-or-units/141783)
----
The description for the coordinates and magnitudes should have an additional ..."`in inches.`" for geometry structs:
* [`SUPoint2D`](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_point2_d.html)
* [`SUPoint3D`](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_point3_d.html)
* [`SUVector2D`](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_vector2_d.html)
* [`SUVector3D`](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_vector3_d.html)
* [`SUUVQ`](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_u_v_q.html)
Certain submatrix values (ie, **not** the **scale** value) for:
* [`SUTransformation`](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_transformation.html)
* [`SUTransformation2D`](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_transformation2_d.html)
Possibly the factors for the [`SUPlane3D`](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_plane3_d.html) equation.
And in several places should explain SketchUp uses inches internally for **length**, **area**, and **volume** values, as well as storing such values in the SKP file format (and that the internal tolerance is 0.001".)
Good places for this note (or link to it) might be:
* the [Main](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/index.html) API introductory page (perhaps a **Units** section?)
* [`SUEntitiesFill()`](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_entities_ref.html#a4c5230af9513a52f80ea9c7fdcf37a22) function
* [`SUGeometryInputRef`](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_geometry_input_ref.html)
* [`SULengthFormatterRef`](https://extensions.sketchup.com/developers/sketchup_c_api/sketchup/struct_s_u_length_formatter_ref.html)
~
1 Like
sw8806
June 11, 2024, 2:22am
4
OK, thank you for your reply.
Anssi
June 11, 2024, 9:01am
5
Almost the entire world does.
3 Likes