Blender
V3.3
|
#include <math.h>
#include "MEM_guardedalloc.h"
#include "DNA_camera_types.h"
#include "DNA_object_types.h"
#include "BLI_math.h"
#include "BLI_uvproject.h"
Go to the source code of this file.
Classes | |
struct | ProjCameraInfo |
Typedefs | |
typedef struct ProjCameraInfo | ProjCameraInfo |
Functions | |
void | BLI_uvproject_from_camera (float target[2], float source[3], ProjCameraInfo *uci) |
void | BLI_uvproject_from_view (float target[2], float source[3], float persmat[4][4], float rotmat[4][4], float winx, float winy) |
ProjCameraInfo * | BLI_uvproject_camera_info (Object *ob, float rotmat[4][4], float winx, float winy) |
void | BLI_uvproject_from_view_ortho (float target[2], float source[3], const float rotmat[4][4]) |
void | BLI_uvproject_camera_info_scale (ProjCameraInfo *uci, float scale_x, float scale_y) |
typedef struct ProjCameraInfo ProjCameraInfo |
ProjCameraInfo* BLI_uvproject_camera_info | ( | struct Object * | ob, |
float | rotmat[4][4], | ||
float | winx, | ||
float | winy | ||
) |
Create UV info from the camera, needs to be freed.
rotmat | can be obedit->obmat when uv project is used. |
winx,winy | can be from scene->r.xsch / ysch . |
Definition at line 120 of file uvproject.c.
References CAM_PANO, CAM_PERSP, ProjCameraInfo::camangle, camera, ProjCameraInfo::caminv, ProjCameraInfo::camsize, copy_m4_m4(), Object::data, ProjCameraInfo::do_pano, ProjCameraInfo::do_persp, ProjCameraInfo::do_rotmat, focallength_to_fov(), invert_m4(), MEM_mallocN, normalize_m4(), NULL, Object::obmat, ProjCameraInfo::rotmat, ProjCameraInfo::shiftx, ProjCameraInfo::shifty, tanf, ProjCameraInfo::xasp, and ProjCameraInfo::yasp.
Referenced by uv_from_view_exec(), and uvprojectModifier_do().
void BLI_uvproject_camera_info_scale | ( | struct ProjCameraInfo * | uci, |
float | scale_x, | ||
float | scale_y | ||
) |
So we can adjust scale with keeping the struct private.
Definition at line 180 of file uvproject.c.
References ProjCameraInfo::xasp, and ProjCameraInfo::yasp.
Referenced by uvprojectModifier_do().
void BLI_uvproject_from_camera | ( | float | target[2], |
float | source[3], | ||
struct ProjCameraInfo * | uci | ||
) |
Apply UV from uvinfo (camera).
Definition at line 27 of file uvproject.c.
References angle(), atan2f, ProjCameraInfo::camangle, ProjCameraInfo::caminv, ProjCameraInfo::camsize, copy_v3_v3(), ProjCameraInfo::do_pano, ProjCameraInfo::do_persp, ProjCameraInfo::do_rotmat, float(), len_v2(), M_PI, mul_m4_v4(), ProjCameraInfo::rotmat, ProjCameraInfo::shiftx, ProjCameraInfo::shifty, ProjCameraInfo::xasp, and ProjCameraInfo::yasp.
Referenced by uv_from_view_exec(), and uvprojectModifier_do().
void BLI_uvproject_from_view | ( | float | target[2], |
float | source[3], | ||
float | persmat[4][4], | ||
float | rotmat[4][4], | ||
float | winx, | ||
float | winy | ||
) |
Apply uv from perspective matrix.
persmat | Can be rv3d->persmat . |
Definition at line 79 of file uvproject.c.
References copy_v3_v3(), fabsf, mul_m4_v4(), x, and y.
Referenced by uv_from_view_exec().
Apply orthographic UV's.
Definition at line 169 of file uvproject.c.
References mul_v3_m4v3().
Referenced by uv_from_view_exec().