True object billboarding problem

Started by
9 comments, last by Rannion 8 years, 11 months ago

Ok, for those who were following this ticket, this is dead simple. I guess I needed a good night...

To find the point E, I was projecting in screen space j2-j1 * radius. This is of course projecting the real 3d position.

What we need to do here is to find the projected radius length which is on the plane of the camera so: j1 + camUp * radius;

Project that result and then just do (projJ1Pos - projRadius).len() = projRadiusLength;

Then from here of course you can find E = projJ1Pos + (projJ2Pos - projJ1Pos).normalize() * projRadiusLength.

As mention in previous post, this is in screen space so we divide x and y by screen width and height, put everything in the range -1..1 and we are done.

In the shader no need for view nor pojection transform, just modelToWorld transform.

This topic is closed to new replies.

Advertisement