Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 01 Feb 2013
Offline Last Active Jul 16 2015 09:39 AM

#5227250 True object billboarding problem

Posted by Rannion on 05 May 2015 - 01:29 AM

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.


#5102343 D3DFMT_R16F format and D3DXFLOAT16

Posted by Rannion on 18 October 2013 - 03:24 AM

Found my stupid mistake finally...

Just had to specify D3DX_DEFAULT_NONPOW2 when loading the texture ! Damn default parameters...

Post could be deleted I guess.