Gets the current camera values.
#include "ltwrappr.h"
virtual L_INT LVectorBase::GetCamera(pVectorCamera)
Pointer to a VECTORCAMERA structure to be updated with the current camera values.
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 LVectorBase::Paint.
/* LVectorBase::GetCamera() */
/* LVectorBase::SetCamera() */
L_INT LVectorBase__GetCameraExample(HWND hWnd)
{
L_INT nRet;
VECTORCAMERA camera;
L_TCHAR szTemp[300];
LVectorBase Vector;
nRet = Vector.Load(MAKE_IMAGE_PATH(TEXT("random.dxf")));
if(nRet != SUCCESS)
return nRet;
nRet = Vector.GetCamera(&camera);
if(nRet != SUCCESS)
return nRet;
wsprintf(szTemp,
TEXT("New Camera\nTheta[%f]\nPhi[%f]\nLookAt[%f,%f,%f]\nDistance[%lf]\nPerspective[%s]"),
camera.Theta,
camera.Phi,
camera.LookAt.x,
camera.LookAt.y,
camera.LookAt.z,
camera.Distance,
camera.bPerspective? TEXT("TRUE"): TEXT("FALSE")
);
MessageBox(hWnd, szTemp, TEXT(""), MB_OK);
camera.Theta +=20;
nRet = Vector.SetCamera(&camera);
if(nRet != SUCCESS)
return nRet;
wsprintf(szTemp,
TEXT("New Camera\nTheta[%f]\nPhi[%f]\nLookAt[%f,%f,%f]\nDistance[%lf]\nPerspective[%s]"),
camera.Theta,
camera.Phi,
camera.LookAt.x,
camera.LookAt.y,
camera.LookAt.z,
camera.Distance,
camera.bPerspective? TEXT("TRUE"): TEXT("FALSE")
);
MessageBox(hWnd, szTemp, TEXT(""), MB_OK);
return SUCCESS;
}