GraphicControl.ProjectPointToScreen returning bogus values?
Dirka3
✭
Copied from Upfeed forum since this may be more appropriate here...
Hello,
I'm trying to use the GraphicControl.ProjectPointToScreen(Vector3) method to get the appropriate XY screen location of an object that has been selected in the graphics view, in my case a primitive sphere with local coordinate system at the center.
The function is always returning X=(1/2 graphics window width) or (1/2 graphics window width + 1) (determined by selected object on left or right half of screen) and Y=0.
I have confirmed the Vector3 point I am asking for is correct by using the GraphicControl.ExaminePoint() method, the view immediately focuses on my selected sphere.
I have also tried scaling the Vector3 by various factors of ten, and the results are different, but the desired screen coordinate is never returned.
Has anyone else experienced issues with this method? Is there some kind of GraphicControl 'update' method i need to call before using ProjectPointToScreen?
Thanks!
Levi
Hello,
I'm trying to use the GraphicControl.ProjectPointToScreen(Vector3) method to get the appropriate XY screen location of an object that has been selected in the graphics view, in my case a primitive sphere with local coordinate system at the center.
The function is always returning X=(1/2 graphics window width) or (1/2 graphics window width + 1) (determined by selected object on left or right half of screen) and Y=0.
I have confirmed the Vector3 point I am asking for is correct by using the GraphicControl.ExaminePoint() method, the view immediately focuses on my selected sphere.
I have also tried scaling the Vector3 by various factors of ten, and the results are different, but the desired screen coordinate is never returned.
Has anyone else experienced issues with this method? Is there some kind of GraphicControl 'update' method i need to call before using ProjectPointToScreen?
Thanks!
Levi
Tagged:
0
Comments
-
Hi Levi,
I have tested and found that it works almost as intended.
Please note that the returned point is relative to the upper left corner of the graphics window (not the screen). There is however a bug that causes the Y value to be inverted and offset by 1/2 the window height...
That will be fixed in 6.06. This shows the (corrected) behavior:
https://youtu.be/9_wrEqBPcds
Regards,
Johannes
Post edited by Johannes Weiman onJohannes Weiman
Software Engineer
RobotStudio Team, ABB Robotics0 -
Hi Johannes,
Thanks for the report!
I can work around the Y bug until 6.06, that is great that is fixed.
After your video showed the X value working I tried creating my RobotStudio station from scratch in 6.05.01 and my problem with X returning incorrectly went away running the same add-in code. The station I previously tested on has been saved/upgraded through several versions of RobotStudio, starting with probably 6.0. This is just FYI, no further action required.
Thanks again!
Levi0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 783 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings