Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Ewering <blender@instinctive.de>2003-09-27 15:10:49 +0400
committerAlexander Ewering <blender@instinctive.de>2003-09-27 15:10:49 +0400
commitb843c8a0ea40b0089e522f11b40eee9cb0801232 (patch)
treee9683a69da9cbd988e822ca3c78b0532ebea5af7 /source/blender/src/view.c
parent3cf1cacd5dbf0efe61501762444ba26531614b86 (diff)
"Set Camera to View3d": SHIFT-NUMPAD0 selects the camera like NUMPAD0, and
in addition aligns and positions it so that it exactly "sees" the former View3d.
Diffstat (limited to 'source/blender/src/view.c')
-rw-r--r--source/blender/src/view.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
index 30eb5acbb9b..b1d0c367cec 100644
--- a/source/blender/src/view.c
+++ b/source/blender/src/view.c
@@ -711,6 +711,26 @@ void setviewmatrixview3d()
}
}
+void setcameratoview3d()
+{
+ Object *ob;
+ float dvec[3];
+
+ ob= G.vd->camera;
+ dvec[0]= G.vd->dist*G.vd->viewinv[2][0];
+ dvec[1]= G.vd->dist*G.vd->viewinv[2][1];
+ dvec[2]= G.vd->dist*G.vd->viewinv[2][2];
+ VECCOPY(ob->loc, dvec);
+ VecSubf(ob->loc, ob->loc, G.vd->ofs);
+ G.vd->viewquat[0]= -G.vd->viewquat[0];
+ if (ob->transflag & OB_QUAT) {
+ QUATCOPY(ob->quat, G.vd->viewquat);
+ } else {
+ QuatToEul(G.vd->viewquat, ob->rot);
+ }
+ G.vd->viewquat[0]= -G.vd->viewquat[0];
+}
+
/* IGLuint-> GLuint*/
short selectprojektie(unsigned int *buffer, short x1, short y1, short x2, short y2)
{