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. Best way to develop 3D math functions visualization
Forum Update on Monday, May 27th 2025

Best way to develop 3D math functions visualization

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.2k Views
  • 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.
  • L Offline
    L Offline
    Luca B
    wrote on last edited by Luca B
    #1

    Greetings,
    I'm a long time Qt user, but I never approached this problem before.
    What's currently the best way to implement a 3D function visualiser?
    The problem is simple: I've a 2 dim math function (DeJong, Rosenbrock, you name it) and I need to produce a visual representation of it under a given range.
    Ideally, it should be able to generate the points on the fly, in order to keep the same resolution disregarding the zoom level (I'll pass the function to the widget, and it will produce a smooth plot).
    Features like gradient-color and the possibility to (programmatically) add/remove some points (namely colored markers) on it is also nice to have.

    As far as I've seen some solutions should involve the use of QwtPlot3D or some widgets types provided by Qt5, but I'm not really sure what's the best option given my problem, and I hope someone can give me some hints about it.

    Cheers.

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Qt Data Visualization covers the plotting part, calculating the points is up to you though

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      L 1 Reply Last reply
      0
      • VRoninV VRonin

        Qt Data Visualization covers the plotting part, calculating the points is up to you though

        L Offline
        L Offline
        Luca B
        wrote on last edited by Luca B
        #3

        @VRonin said in Best way to develop 3D math functions visualization:

        Qt Data Visualization covers the plotting part, calculating the points is up to you though

        What you mean calculating the points?
        I've already implemented the functions I need to plot.
        Let's say all of them share the common interface function that return the y value given the coordinate (x,z)

        double compute(double x, double z) const;
        

        So computing the constituent points of the surface is not an issue, the problem is to visualise that surface given an implementation of the quoted C++ function.

        EDIT: This is the closest example of what I'm looking for, however it works on a finite number of samples (ok) that need to be filled with ground values (not ok) instead of being generated on fly (so no infinite resolution).
        Worst case scenario, I've to intercept the zooming signal (assuming he's providing me one) and re-generate each point everytime I zoom in/out.
        It's doable, but I'm wondering if I'm missing an already implemented feature that do this for me.

        1 Reply Last reply
        0
        • gde23G Offline
          gde23G Offline
          gde23
          wrote on last edited by
          #4

          as VRonin mentioned Qt Data Visualization is one methode.
          Here is some 3d-surface exampe
          If you are using eigen3 for the math part whats really nice for developping is some pretty-printers, that can plot data from eigen-vectors during debugging.
          If you are interested in the scripts i can upload them (i have them on another machine not here atm)

          1 Reply Last reply
          1

          • Login

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