Ambiguous "target" in SUCameraGetOrientation

I’m using the Sketchup C API to read information about all scenes in a Sketchup file, including their camera positions and orientations. However, I’m not sure how to treat the “target” variable returned by the SUCameraGetOrientation function. The documentation lacks a hint towards what the the elements in this SUPoint3D represent; I’ve tried using it as a local-space direction vector and a world-space “look at” target, but neither method returns results I expect.

Some more clarity about the purpose of the “target” result in SUCameraGetOrientation would help demystify the process and help me avoid getting confused; can anyone that has used SUCameraGetOrientation in the past point me in the right direction (no pun intended)?

I’ve not used these C APIs, but the documentation indicates that the “position” returned is the co-ordinate point of the camera and the “target” returned is the co-ordinate of the focal point of the camera. The distance between the camera and target along with the aspect ratio (and/or the field-of-view if perspective) determines the effective 2D projected frame that will be displayed.

The Ruby API equivalent terms are:

Camera.eye: The eye method is used to retrieve the eye Point3d object for the Camera.

and The target method retrieves Point3d that the camera is pointing at.

But, it’s “right on the mark.” (pun totally intended!)

The Ruby API classes and methods are wrappers around the native C-side functions. The Ruby API documentation is much more verbose.

So, take a look at SketchUp’s Ruby class docs for:
Sketchup::Camera, Sketchup::View, Geom::Point3d, Geom::Vector3d classes

I haven’t used the C++ SDK either. The Ruby API can return a target object that is a 3 dimensional position. I’m not sure if it always has meaning. If you are zooming on a model that is centered in the view, then I suppose it represents the position on the model that is the center of the zoom. On the other hand, if you zoom off center, or if you orbit and pan, it is likely that it is an arbitrary point in front of the camera “eye” (method returning camera position) that establishes the “direction” vector that the camera is pointing.

In order to create a camera object, the constructor needs at least an eye position, target position and an up direction vector. I have created camera objects with Ruby code, and I can set the target value 1 inch or a 100 feet in the desired direction away from the eye position and the distance from the eye doesn’t affect the view. The camera constructor does not take three axes and a position to establish its coordinate system. The eye argument establishes its position, the target is a point that can be used to establish the direction axis as the vector from the eye to the target. The last mandatory argument to the constructor is the up axis.

@jimhami42 image has the model centered in the camera view. That isn’t always the case. I would expect the target position to sometimes be meaningless other than to establish the direction vector.