PDA

View Full Version : Qwt 3D problem



UndeadDragon
16th November 2012, 13:08
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.

double operator (double x, double y);
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

Qwt3D::Triple operator()(double x, double y);
And it was success way but only one problem...
I want to had something like that:
8421
But I have that:
8420
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:


Qwt3D::Triple func3D::operator()(double x, double y){

return Qwt3D::Triple(x,proc->getFromPoint(x,"T")/10,proc->getFromPoint(x,"h")/1000);

}

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


double v,b,n;
double c = 1.9;
v = (c + cos(y)) * cos(x);
b = (c + cos(y)) * sin(x);
n = sin(y) + cos(y);
return Qwt3D::Triple(v,b,n);

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

amleto
16th November 2012, 13:31
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

Qwt3D::Triple func3D::operator()(double x, double y){
return Qwt3D::Triple(x,proc->getFromPoint(x,"T")/10,proc->getFromPoint(x,"h")/1000);
}
should probably be more like


Qwt3D::Triple func3D::operator()(double x, double y){
return Qwt3D::Triple(x,y, proc->getFromPoint(x,"h")/1000);
}