[Soc-2017-dev] Silhouette Operator Orthographic Matrix
Sebastian Witt
W.Basti at gmx.de
Wed Aug 2 14:13:47 CEST 2017
Hi,
I ran into a small problem. For the algorithm which calculates the
intersection I need to project 3D points to 2D view coordinates.
To do so I used:
ED_view3d_project_float_v2_m4(const ARegion *ar, const float co[3],
float r_co[2], float mat[4][4])
This works as expected. But since the Silhouette is generated on a plane
orthogonal to the camera I need the correct matrix for this function.
For now I used:
ED_view3d_ob_project_mat_get(const RegionView3D *rv3d, Object *ob,
float pmat[4][4])
Which is the same as:
mul_m4_m4m4(vmat, (float (*)[4])rv3d->persmat, ob->obmat);
or:
mul_m4_m4m4(vmat, (float (*)[4])rv3d->viewmat, ob->obmat);
mul_m4_m4m4(pmat, (float (*)[4])rv3d->winmat, vmat);
*The Problem:*
The winmat is the perspective matrix if in perspective camera mode.
Therefore *i need the orthographic winmat* while being in perspective mode.
Is it saved somewhere?
To workaround this I also tried a combination of:
ED_view3d_viewplane_get()
orthographic_m4()
which didn't work because "ED_view3d_viewplane_get()" returns different
values for the viewplane if in perspective mode. (as expected)
For now i can just use the perspective matrix and work on other parts.
Let me know if you know where i can get the orthographic winmat.
have a nice day,
Sebastian Witt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/soc-2017-dev/attachments/20170802/e3b78edc/attachment.htm
More information about the Soc-2017-dev
mailing list