Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Open GL Coordinate system
Qt 6.11 is out! See what's new in the release blog

Qt Open GL Coordinate system

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,

    Let's say I have two coordinate axis rendered correspondingly:

    @
    ...
    glBegin(GL_LINES);
    //y
    glVertex2f(-1.5, -1.5);
    glVertex2f(-1.5, 1.5);
    //y arrow
    glVertex2f(-1.5, 1.5);
    glVertex2f(-1.4, 1.4);

        glVertex2f(-1.5, 1.5);
        glVertex2f(-1.6, 1.4);
    glEnd();
    

    ...
    @
    @
    ...
    glBegin(GL_LINES);
    //x
    glVertex2f(-1.5, -1.5);
    glVertex2f( 1.5, -1.5);
    //x arrow
    glVertex2f(1.5, -1.5);
    glVertex2f(1.4, -1.4);

        glVertex2f(1.5, -1.5);
        glVertex2f(1.4, -1.6);
    glEnd();
    

    ...
    @

    I also have a .csv file from which read the data and store it in a
    @
    QHash<QString, QVector<float> >
    @.
    Now I need to plot the points that I have read from the .csv file into my "coordinate system".

    Q: How to evaluate my coordinate system in that way (let's say from 0 to 20), that the points read would be plot in the coordinate system w.r.t. that values.

    Example: The points read {2.4, 3.1}, {19.9, 1.7} must be plot w.r.t. to fact that the {0.0} is the crossroad of the axis (in my case {-1.5, -1.5}), and the end points of my axis are correspondingly X - {20, 0} (in my case {1.5, -1.5}) and Y - {0, 20} (in my case {-1.5, 1.5}).

    P.S. : theoretically I know that it some how must be translating my world coordinate system into mine, but that's all that I know, and have no idea how it is done.

    Thanks in advance.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved