Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forum
Open Source community
Training and e-learning
A la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forum / project/convert 3D points into screen coordinates?

Forum

project/convert 3D points into screen coordinates?
Jonas Svensson2010/03/02 17:46
Hi all!
I am looking for an explanation how to get the screen coordinates at which some 3D point will be displayed. (A more abstract description is: I have some imaginary 3D line, which is not displayed. Think of the screen representation of this line. I want to find the point on this line which is closest to the mouse pointer, assuming it was displayed.)

In the thread http://www.opencascade.org/org/forum/thread_2785/ I found the function ConvertToPlane that projects mouse coordinates into 3D space, and there into a specific plane to be more precise. For this purpose the View class offers the methods Convert() and Proj().

But how can I go the other direction? How do I project a 3D point onto the view plane and then convert it into mouse/screen coordinates? Are some methods available for this calculation?

Thanks
Jonas
Tilman Leune2010/03/03 07:27
The functionality you need can be found in the V3d-Package.

From the reference documentation:

V3d_View::Convert (const V3d_Coordinate Xv, const V3d_Coordinate Yv, Standard_Integer &Xp, Standard_Integer &Yp) const
Converts the point defined in the reference frame
of the projection plane into a point PIXEL.
Jonas Svensson2010/03/03 11:58
Thank you very much! I should have had a closer look at the various methods of V3d_View.

Jonas
Tilman Leune2010/03/03 12:17
Well, OCC provides about 15k-20k different classes, so it is quite easy not to find what you are looking for. Thats what this forumis for: giving nudges in the rigth direction ;)
 
 
Latest news
  • FAQ section updated
  • OPEN CASCADE Uses Intel ® Parallel Studio XE to Introduce Parallelism into SALOME SMESH Module
  • Open CASCADE Technology 6.5.2 is available for download!

  • © OPEN CASCADE 2000 - 2012  |  Search  |  Contacts   |  Site map