How to dock a 3d object in the view of a camera relative to the viewport size?

E.g. a 3d panel that is docked to the right of the camera’s view at a set distance?
PanelOffset.ts

Original Post on Discord

by user 103054507105067008

Figured it out here for docking a 3d panel to the right of the screen, change the values as you need but hope this helps anyone else who needs to do this!

by user 103054507105067008