Krzysztof Kosiński wrote:
W dniu 4 kwietnia 2010 00:12 użytkownik <J.B.C.Engelen@...1578...> napisał:
Confirmed on Jabber. Exporting PDF with "export area is drawing" set does not work correctly and exports wrong area. (also not LaTeX, but that's related).
Fixed in 9290.
The 3DBox regression is rather complex. The perspective is saved to XML in desktop coordinates rather than SVG document coordinates, and as a result 3D boxes are inverted on the Y-axis when loaded from a file created by a pre-switch version of Inkscape. The fact that I have no idea what the saved values mean doesn't help. :)
Places to look:
- box3d.cpp
- persp3d.cpp
- proj_pt.cpp
- transf_mat_3x4.cpp
If someone could tell me what actually determines where the vanishing points are shown, it would help. (Maybe I'll figure it out on my own tommorow.)
My guess would that it uses homogenous coordinates, 2D for the perspective definition and 3D for the actual cube. This means that for the perspective definition there are 3 coordinates given: the x, y and "w" values for each of the three vanishing points. The actual location of the vanishing point is then given by (x,y)/w, if w is zero the vanishing point is usually taken to lie infinitely far along the ray (x,y)*t (probably relative to persp3d-origin?).
For the 3d box itself corner0 appears to be the top-left-back corner and corner7 the opposite corner (bottom-right-front). Again these are using homogenous coordinates (but now in 3D, so with 4 values per point). The scale is related to the perspective definition. For example, if the origin is set to (0,0) and w=0 for all vanishing points then (x,y,z) in the box corresponds to x*vp_x+y*vp_y+z*vp_z (only taking the (x,y) part of the vanishing points).