Results 1 to 2 of 2

Thread: Qwt 3D problem

  1. #1
    Join Date
    Oct 2012
    Posts
    5
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded

    Default Qwt 3D problem

    Hi all!
    I have 3 vectors with points from one of my modul's. I tried to build 3D plot using Qwt 3D. It is an old but interesting library for 3D plots using openGL. Many hours I'm has been tried to compile this library, and today it was success. Now I have new problem for many-many hours. The simplest way to build curve in this library - create class with reloaded operator with inheritance from class Fucntion.
    Qt Code:
    1. double operator (double x, double y);
    To copy to clipboard, switch view to plain text mode 
    But I can't go this way - i have something like x,y=f1(x),z=f2(x), I mean I have two functions, not one z=f(x,y) like used this operator.
    I tried to inheritance from another class Qwt3D::ParametricSurface because he used to build 3D plot operator
    Qt Code:
    1. Qwt3D::Triple operator()(double x, double y);
    To copy to clipboard, switch view to plain text mode 
    And it was success way but only one problem...
    I want to had something like that:
    3d_mainwindow.gif
    But I have that:
    fa6fe89c4b60.jpg
    It's just a curve and i don't know what i need to do to have nice plot like first Maybe I doing something wrong or something don't understood...
    Please help me somebody!
    Thanks a lot!

    P.S. that's a code that creating plot:

    Qt Code:
    1. Qwt3D::Triple func3D::operator()(double x, double y){
    2.  
    3. return Qwt3D::Triple(x,proc->getFromPoint(x,"T")/10,proc->getFromPoint(x,"h")/1000);
    4.  
    5. }
    To copy to clipboard, switch view to plain text mode 

    proc is an object that just perform calculation.
    x and y substituting buy library, I tried to understand but don't know how.
    If return replace with code

    Qt Code:
    1. double v,b,n;
    2. double c = 1.9;
    3. v = (c + cos(y)) * cos(x);
    4. b = (c + cos(y)) * sin(x);
    5. n = sin(y) + cos(y);
    6. return Qwt3D::Triple(v,b,n);
    To copy to clipboard, switch view to plain text mode 

    We will have:
    f42de7b09123.jpg
    I want this result but don't understand what the problem

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qwt 3D problem

    we have a qwt forum for qwt questions...


    Added after 10 minutes:


    two things don't make sense.

    1)
    But I can't go this way - i have something like x,y=f1(x),z=f2(x),...
    Then you can't use functions where don't have z=f(x,y)!

    x,y=f1(x),z=f2(x) <-- this is a PATH in 3-space. It does NOT define a surface so you cannot expect to get a surface plot!

    2) If you do want a surface plot, then
    Qt Code:
    1. Qwt3D::Triple func3D::operator()(double x, double y){
    2. return Qwt3D::Triple(x,proc->getFromPoint(x,"T")/10,proc->getFromPoint(x,"h")/1000);
    3. }
    To copy to clipboard, switch view to plain text mode 
    should probably be more like
    Qt Code:
    1. Qwt3D::Triple func3D::operator()(double x, double y){
    2. return Qwt3D::Triple(x,y, proc->getFromPoint(x,"h")/1000);
    3. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by amleto; 16th November 2012 at 13:31.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. The following user says thank you to amleto for this useful post:

    UndeadDragon (18th November 2012)

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
  •  
Qt is a trademark of The Qt Company.