0
\$\begingroup\$

I am creating an editor where I have "grabhandles" that can be dragged to transform a primitive object.

My problem is that I can't find the correct solution to show these grabhandles in a perspective view.

They need to have the correct position AND same size independent of where they are,how far away they are on the perspective viewport and independent of what the viewport dimensions are.

Untitled.png

In orthographic mode I do not have this problem as I create the handle polygons by multiplying it with a zoom factor.

Untitled (1).png

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You could project the 3D points to screen and then do a 2D rendering of the points and paste those over the main image. The size would be consistent then.

Another option would be billboarding, where you could make the object always face the camera and you can fix the size of the objects by manipulating the transforms. Here is a good article on billboarding that includes fixed sizing.

\$\endgroup\$
3
  • \$\begingroup\$ I am having a problem though, it seems like the handles are projected twice in persp view... in the opposite direction. how do I handle coordinates that are behind me? Or outside of my view, left/right. \$\endgroup\$
    – Wilds
    Dec 30, 2016 at 15:14
  • \$\begingroup\$ Frustum culling is probably the way to go to eliminate the rendering of points outside your view. \$\endgroup\$ Dec 30, 2016 at 15:20
  • \$\begingroup\$ I managed to get it right using the 3D fixed-size way used in the article you linked! Thanks alot! \$\endgroup\$
    – Wilds
    Dec 30, 2016 at 16:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .