Make drawn PostDrawOpaqueRenderables face the player

How would I using the hook PostDrawOpaqueRenderables’s GUI elements face the player consistently no matter the camera angle?

The elements are drawn onto a 2D canvas but it appears behind translucent items since those are painted after the hook to PostDrawOpaqueRenderables is called.

Try drawing your stuff in the PostDrawTranslucentRenderables hook instead, then see if you have the same issue.

If you do, then I’m out of suggestions - other than subtracting the position of the object from the position of the viewer and normalizing the vector (or something like that) - I didn’t quite pay enough attention in mathematics but I can sort of get by. Is this a dot product scenario or a cross product one? Who knows…

I think you misunderstood my question slightly, I want to know how to make it angle based on the players position
Im very poor at using angles so I am not sure how to calculate it
If player is south of the gui the gui faces south.


Well, I can’t remember exactly how I did it, but I did that calculation (the one you will need for this) when I made the addon “Wire Directional Radio Kit” which is part of the wire UWSVN repository.

Have a look at line 147.

In there, the angle between two antennae is calculated. The same sort of calculation applies when setting the angle of your 3D2D thing. You might need to think it through a bit though.

I failed mathematics at school so it took me a while to work it out - but be assured that I did eventually work it out (and understand it) - so you will be able to too :slight_smile: