0
\$\begingroup\$

Instead of thousand words, a few pictures to explain what I want to achieve enter image description here enter image description here How do I get the merit of UI objects rotation in perspective projection, but ignore the position of an object(as in Overlay Canvas)?

UPDATE 1

Can you include an example of what your full UI or scene would look like?

A usual bar which is used to hold stuff like score. Same base prefab is used for mana/health and any other UI parameter on screen. But bars have different rotations, so here is one solution - have a unique sprite for every special rotation and have a bunch of prefabs(nah). Or have one sprite, one prefab and set the rotation in scene(that's the way).

Is there a reason you are asking for this in perspective projection?

Just because I want to be able to rotate UI objects in scene and show the "depth" of rotated object. I'm not particularly stuck onto perspective projection, as long as I can achieve the "want" look without actually redrawing sprites for every unique angle.

so I'm not sure what you are asking for. Are you asking how to skew an image in 2D, so that it looks like a 3D perspective projection?

I know it sounds crazy, since it's obvious that in perspective looking at object which is above camera you get that "looking from down" look. And yet I feel you are onto something(and now am I), one way of thinking is actually to skew a 2D image to simulate rotation as in perspective view!

\$\endgroup\$
4
  • \$\begingroup\$ You can shift the vanishing point using an oblique frustum. But if you want a different vanishing point for each UI element then things get complicated quickly. Can you include an example of what your full UI or scene would look like? \$\endgroup\$
    – DMGregory
    Jul 20, 2018 at 14:36
  • \$\begingroup\$ If I understand you correctly, you need an orthographic projection, and not a perspective one. Is there a reason you are asking for this in perspective projection? \$\endgroup\$
    – TomTsagk
    Jul 20, 2018 at 14:36
  • \$\begingroup\$ Orthographic projection will map the 3D object to the screen without depth distortion, but you will not get a result that looks like the top image (labeled WANT), because the top image is a perspective projection (i.e. side that's closer is larger, and the side that is farther is smaller), so I'm not sure what you are asking for. Are you asking how to skew an image in 2D, so that it looks like a 3D perspective projection? \$\endgroup\$
    – Kyy13
    Jul 20, 2018 at 14:49
  • \$\begingroup\$ I updated question in regards to your remarks, hope it clears any possible misunderstandings \$\endgroup\$ Jul 20, 2018 at 15:07

0

You must log in to answer this question.

Browse other questions tagged .