Screen-aligned object

Technical discussions
Post Reply
Jesenšek lajović
Posts: 1
Joined: Wed Jun 26, 2019 6:16 am

Screen-aligned object

Post by Jesenšek lajović »

Hello

I am trying to implement positioning of an object relative to the screen, so it stays at the top right corner when the view is rotated. I will manipulate its orientation in my program. So it is not a 2d object.
Is it possible in v6.0 ?

Thanks

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Screen-aligned object

Post by Prashant Kande »

Hi Jesenšek
I has to be done per rendering frame it might not be noticeable, but generally it slows down rendering.
You need to request ClientDraw event:
http://www.dynoinsight.com/Help/V6_0/Co ... ClientDraw
and add a handler to get notified about frames.

You will need to convert your screen-aligned coordinates defined relative to the eye frame
http://www.dynoinsight.com/Help/V6_0/Gr ... lView.aspx to global coordinates.

After that you can get reference to local frame of your gadget entity via http://www.dynoinsight.com/Help/V6_0/In ... etLocation
and set its global location/orientation

http://www.dynoinsight.com/Help/V6_0/In ... ScreenTo3D, http://www.dynoinsight.com/Help/V6_0/In ... tPixelSize and similar methods might be used to figure out dimensions and map pixels to 3D sizes

I hope to find time today to write a code snipped
Cheers

Post Reply