#include "lvkrn.h"
L_LVKRN_API L_INT L_VecGetCamera(pVector, pCamera)
Gets the current camera settings.
Pointer to a vector handle.
Pointer to a VECTORCAMERA structure to be updated with the current camera settings.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function will get the current viewing camera.
The camera is used with the view port to determine how the drawing will be projected into the destination DC when using L_VecPaint.
Required DLLs and Libraries
This example will show current camera settings in a message box.
L_INT VecGetCameraExample(pVECTORHANDLE pVector)
{
L_INT nRet;
VECTORCAMERA camera; /* Camera */
L_TCHAR szBuffer[ 200 ]; /* Buffer */
/* Get camera */
nRet = L_VecGetCamera( pVector, &camera );
if (nRet != SUCCESS)
return nRet;
/* Format values into a buffer */
_stprintf_s( szBuffer,200, TEXT("Theta = %f\nPhi = %f\nLookAt = %f, %f, %f\nDistance = %f\nPerspective = %d"),
camera.Theta, camera.Phi, camera.LookAt.x, camera.LookAt.y, camera.LookAt.z, camera.Distance, camera.bPerspective );
MessageBox( NULL, szBuffer, TEXT("Camera"), 0 );
return SUCCESS;
}