51 target[1] = pv4[1] / uci->
camsize;
67 target[0] = (pv4[0] / uci->
camsize);
68 target[1] = (pv4[1] / uci->
camsize);
71 target[0] = (-pv4[0] * ((1.0f / uci->
camsize) / pv4[2])) / 2.0f;
72 target[1] = (-pv4[1] * ((1.0f / uci->
camsize) / pv4[2])) / 2.0f;
76 target[0] *= uci->
xasp;
77 target[1] *= uci->
yasp;
91 float pv4[4],
x = 0.0,
y = 0.0;
101 if (
fabsf(pv4[3]) > 0.00001f) {
102 target[0] = winx / 2.0f + (winx / 2.0f) * pv4[0] / pv4[3];
103 target[1] = winy / 2.0f + (winy / 2.0f) * pv4[1] / pv4[3];
107 target[0] = winx / 2.0f + (winx / 2.0f) * pv4[0];
108 target[1] = winy / 2.0f + (winy / 2.0f) * pv4[1];
113 y = (winx - winy) / 2.0f;
117 x = (winy - winx) / 2.0f;
121 target[0] = (
x + target[0]) / winx;
122 target[1] = (
y + target[1]) / winy;
126 const float rotmat[4][4],
158 uci.
yasp = winx / winy;
161 uci.
xasp = winy / winx;
195 uci->
xasp *= scale_x;
196 uci->
yasp *= scale_y;
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
void mul_m4_v4(const float mat[4][4], float r[4])
bool invert_m4(float mat[4][4])
void normalize_m4(float R[4][4]) ATTR_NONNULL()
float focallength_to_fov(float focal_length, float sensor)
MINLINE float len_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_v3(float r[3], const float a[3])
Object is a sort of wrapper for general info.
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Read Guarded memory(de)allocation.
GREAL2 vec2d[2]
Double vector 2D.
void * MEM_mallocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void BKE_uvproject_from_view(float target[2], float source[3], float persmat[4][4], float rotmat[4][4], float winx, float winy)
void BKE_uvproject_from_view_ortho(float target[2], float source[3], const float rotmat[4][4])
ProjCameraInfo * BKE_uvproject_camera_info(const Object *ob, const float rotmat[4][4], float winx, float winy)
void BKE_uvproject_camera_info_scale(ProjCameraInfo *uci, float scale_x, float scale_y)
void BKE_uvproject_camera_info_free(ProjCameraInfo *uci)
void BKE_uvproject_from_camera(float target[2], float source[3], ProjCameraInfo *uci)