diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2007-09-01 13:29:40 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2007-09-01 13:29:40 +0000 |
| commit | 342d2fa9c8f2612684843f2c30ecd875126f0667 (patch) | |
| tree | a9e5b55304697e06f8cd77ab9068c9a21540c084 /src/box3d.cpp | |
| parent | r16474@tres: ted | 2007-08-31 21:37:33 -0700 (diff) | |
| download | inkscape-342d2fa9c8f2612684843f2c30ecd875126f0667.tar.gz inkscape-342d2fa9c8f2612684843f2c30ecd875126f0667.zip | |
Infrastructure to set direction of infinite VPs (now adjustable by some shortcuts; this may be removed later on)
(bzr r3657)
Diffstat (limited to 'src/box3d.cpp')
| -rw-r--r-- | src/box3d.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/box3d.cpp b/src/box3d.cpp index 5e67f46ab..1942ea3d6 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -799,6 +799,23 @@ sp_3dbox_link_to_existing_paths (SP3DBox *box, Inkscape::XML::Node *repr) { } void +sp_3dbox_reshape_after_VP_rotation (SP3DBox *box, Box3D::Axis axis) +{ + Box3D::Perspective3D *persp = inkscape_active_document()->get_persp_of_box (box); + Box3D::VanishingPoint *vp = persp->get_vanishing_point (axis); + + guint c1 = (axis == Box3D::Z) ? 1 : sp_3dbox_get_front_corner_id (box); // hack + guint c2 = c1 ^ axis; + NR::Point v = box->corners[c1] - box->corners[c2]; + double dist = NR::L2 (v) * ((NR::dot (v, vp->v_dir) < 0) ? 1 : -1); // "directed" distance + + Box3D::PerspectiveLine pline (box->corners[c1], axis, persp); + NR::Point pt = pline.point_from_lambda (dist); + + sp_3dbox_move_corner_in_Z_direction (box, c2, pt, axis == Box3D::Z); +} + +void sp_3dbox_move_corner_in_XY_plane (SP3DBox *box, guint id, NR::Point pt, Box3D::Axis axes) { Box3D::Perspective3D * persp = SP_OBJECT_DOCUMENT (G_OBJECT (box))->get_persp_of_box (box); |
