I’m drawing some 2d icons in 3d game using billboarding(they should always face the camera). They purpose is to sign specific places in the scene.
How can I keep icon(image ) sizes small and correct looking while drawing in 3d perspective projection? Is there any known relation between original icon size in pixels and the size to to be given in 3d metric space?
I’m guessing he employed math All he’s doing is computing positions that will effectively reverse the perspective projection, thus keeping it at the correct size.
I can see you were unprojecting the icon position into clip space, but the next step you took was a stroke of genius in my opinion as it’s not immediately obvious to me that the key to this technique is dx * clip.w to ‘perspectively’ correct the icon size.
I suppose if you figure that the next step in the FF pipeline is to perform a perspective divide with a computed clip-space w (just as you did), then it all makes sense as you have just reversed the projection.
Hi
Sorry for bringing it up again.
But now I copied the code to another project where my metric space is relatively large[-2500,2500] and when I do rendering it doesnt work anymore. I can’t see the icons anymore.
It looks like clip vector values are the problem.