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>2010-12-05 05:16:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-05 05:16:01 +0300
commit8a65538fe0ff4d720d23165671888873f142cb5f (patch)
tree30dd7b1b14551c8e27ef75a0dcaaf75f73ca7703 /source/blender/editors/space_view3d/drawobject.c
parent8c467a9c8a0a305182874f7acbaf0d29d82948e6 (diff)
fix for camera border going outside the clipping range while in camera view.
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index e66c1b24419..e489edb5f16 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -1258,13 +1258,22 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob
/* that way it's always visible - clipsta+0.1 */
float fac;
drawsize= cam->drawsize / ((scax + scay + scaz) / 3.0f);
- fac= is_view ? (cam->clipsta + 0.1f) : drawsize;
- depth= - fac*cam->lens/16.0 * scaz;
+
+ if(is_view) {
+ /* fixed depth, variable size (avoids exceeding clipping range) */
+ depth = -(cam->clipsta + 0.1);
+ fac = depth / (cam->lens/-16.0f * scaz);
+ }
+ else {
+ /* fixed size, variable depth (stays a reasonable size in the 3D view) */
+ depth= drawsize * cam->lens/-16.0f * scaz;
+ fac= drawsize;
+ }
+
facx= fac * caspx * scax;
facy= fac * caspy * scay;
shx= cam->shiftx*fac*2 * scax;
shy= cam->shifty*fac*2 * scay;
-
}
vec[0][0]= 0.0; vec[0][1]= 0.0; vec[0][2]= 0.0;