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:
authorCampbell Barton <ideasman42@gmail.com>2011-05-13 22:32:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-13 22:32:27 +0400
commitdaa3dd0e9bc4ebc0e61a7d4a2bbce21f1fef0ce8 (patch)
tree8cff9d449417af5f4090fdefae01476113f9bb9a /source/blender
parent47569160d7487a671e0f7236b1c047496ab90386 (diff)
using the viewmatrix to position the camera could be problematic if the view wasn't yet recalculated, use the quaternion instead.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 8c651e465e1..a58720034bd 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -398,10 +398,14 @@ void VIEW3D_OT_smoothview(wmOperatorType *ot)
void view3d_to_ob(RegionView3D *rv3d, Object *ob)
{
- float dvec[3];
float mat3[3][3];
+ float iviewquat[4];
+ float dvec[3]= {0.0f, 0.0f, rv3d->dist};
+
+ invert_qt_qt(iviewquat, rv3d->viewquat);
+ normalize_qt(iviewquat);
+ mul_qt_v3(iviewquat, dvec);
- mul_v3_v3fl(dvec, rv3d->viewinv[2], rv3d->dist);
sub_v3_v3v3(ob->loc, dvec, rv3d->ofs);
rv3d->viewquat[0]= -rv3d->viewquat[0];