Results 1 to 2 of 2

Thread: how to map scene coordinates to mathematical cartesian graph coordinates

  1. #1
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default how to map scene coordinates to mathematical cartesian graph coordinates

    hi friends,

    how can i map a scene coordinate of rect (-1000,-1000, 2000, 2000) to a cartesian map coordinates.

    im having range and bearing value from which i converted in to cartesian points and now i want to show the points in the QGraphicsview as like mathematical graph

    i can position it using polygonItem but how to convert sceneRect to mathematical graph

    where
    in graph topLeft (-x, +y) topRight( +x, +Y) bottomLeft( -x, -y) bottomRight ( +x, -y)
    but our scene coordinates are topLeft(-x, -y) topRight(+x, -y) bottomLeft(+x, -Y) bottomRight(+x, +y) .

    please help me how i can plot the item on the scene.

    Thnx in advance
    "Behind every great fortune lies a crime" - Balzac

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: how to map scene coordinates to mathematical cartesian graph coordinates

    This is what I understand, you have a data set of points/graph, and want to plot/draw them on QGrpahicsView. If this is what you want, then just invert the y-coordinate value (change y to -y) and every thing will work relatively.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. Calculate scene coordinates from QGraphicsLinearLayout
    By onurozcelik in forum Qt Programming
    Replies: 2
    Last Post: 21st January 2011, 09:38
  2. QGraphicsView, QGraphicsScene item coordinates in scene
    By harakiri in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2010, 11:02
  3. Replies: 4
    Last Post: 18th March 2010, 11:11
  4. Problem with QGraphicsView/Scene coordinates
    By Andrewshkovskii in forum Newbie
    Replies: 12
    Last Post: 19th October 2009, 11:41
  5. Viewport and scene coordinates
    By aurelius in forum Newbie
    Replies: 2
    Last Post: 31st October 2008, 00:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.