|
|
 Prize winner in Competition
"MFC/C++ May 2003"
Comments and Discussions
|
|
 |

|
Good code, I hope to embedded our project,as a preview 3D motion track component, could you tell me how can draw a arc by pssing center plot ,start plot and direct?
anyway, studying your code let me master lots of experiences.
coolman
|
|
|
|
|

|
Aside from scores of warnings about "possible loss of data", C2664 is keeping me from compiling this code in anything but VC++ 6.0. Would someone please post a method to "convert"? The code to convert, not just "oh great, it works now! Because I casted!" or "dude, you gotta cast". Thanx.
GraphCtl.cpp(1078) : error C2664: 'CGraphCtl::SetLight' : cannot convert parameter 1 from 'std::vector<_Ty>::iterator' to 'CElement *'
with
[
_Ty=CElement
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
GraphCtl.cpp(1099) : error C2664: 'CGraphCtl::PtInRange' : cannot convert parameter 1 from 'std::vector<_Ty>::iterator' to 'CPoint3D *'
with
[
_Ty=CPoint3D
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
GraphCtl.cpp(1101) : error C2664: 'CGraphCtl::Coordinate' : cannot convert parameter 1 from 'std::vector<_Ty>::iterator' to 'CPoint3D *'
with
[
_Ty=CPoint3D
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
GraphCtl.cpp(1118) : error C2664: 'CGraphCtl::PtInRange' : cannot convert parameter 1 from 'std::vector<_Ty>::iterator' to 'CPoint3D *'
with
[
_Ty=CPoint3D
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
GraphCtl.cpp(1120) : error C2664: 'CGraphCtl::Coordinate' : cannot convert parameter 1 from 'std::vector<_Ty>::iterator' to 'CPoint3D *'
with
[
_Ty=CPoint3D
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
GraphCtl.cpp(1145) : error C2668: 'sqrt' : ambiguous call to overloaded function
C:\Program Files\VS71\Vc7\include\math.h(626): could be 'long double sqrt(long double)'
C:\Program Files\VS71\Vc7\include\math.h(578): or 'float sqrt(float)'
C:\Program Files\VS71\Vc7\include\math.h(200): or 'double sqrt(double)'
while trying to match the argument list '(std::vector<_Ty>::size_type)'
with
[
_Ty=CPoint3D
]
Quite a mess, huh?
RedDK
|
|
|
|

|
Hy guys,
I need to implement in my C# app same things that control does, just like 3d surfaces and points visualization.
How can I perform this?By wrap the *.dll?And if true why?
Thankyou a lot.
Mirko
|
|
|
|

|
I cannot add property pages because the compiler said "windows.h already include" or similar. Anybody can help me?
Thank you.
|
|
|
|

|
I want to develope a 3D game with vc++ can anyone help
me for using opengl , is there any simple example present
on the net free to download.
If anyone in the same field can help me
ok take care
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|

|
Hi,
Actually I think there is another bug in the PlotElement function.
Indeed, I believe the loop in order to display a surface is wrong.
What about the following code?
...
// Turn on the primitive connection mode (not connected)
glBegin (GL_QUADS) ;
/* Original code
int i, npt = sqrt(theElement->m_PointList.size());
aPoint = theElement->m_PointList.begin();
for (aPoint, i=0; aPoint != theElement->m_PointList.end(); aPoint++,i++)
{
int j,k,n;
if (PtInRange(&(theElement->m_PointList[i])))
{
// i, j, k, n ・4 indices of a quad
// Counter Clockwise direction
j = i + npt; // Other vertices indices
k = j+1;
n = i+1;
*/
int i = 0 ;
int npt = theElement->m_PointList.size() ;
int nxpt = sqrt(npt);
int nypt = sqrt(npt);
int x, y ;
for (i = 0, x = 0 ; x < nxpt-1 ; x++, i++)
for (y = 0; y < nypt-1 ; y++, i++)
{
int j,k,n ;
if (PtInRange(&(theElement->m_PointList[i])))
{
// i, j, k, n ・4 indices of a quad
// Counter Clockwise direction
j = i + nxpt ; // Other vertices indices
k = j+1 ;
n = i+1 ;
...
|
|
|
|

|
Hi,
Thank you for this article. It is great!
However I think there is a small bug in the PtInAxisBox function.
Because we convert the coordinates inside the function Corrdinate,
and then we convert back inside the function PtInAxisBox. If so, this second convertion is wrong.
What about the following code?
BOOL CGraphCtl::PtInAxisBox(CPoint3D* pt)
{
float xF=dRangeX[MAX]-dRangeX[MIN];
float yF=dRangeY[MAX]-dRangeY[MIN];
float zF=dRangeZ[MAX]-dRangeZ[MIN];
CPoint3D point;
/*point.x = (pt->x+dRangeX[MIN])/xF + 0.5f;
point.y = (pt->y+dRangeY[MIN])/yF + 0.5f;
point.z = (pt->z+dRangeZ[MIN])/zF + 0.5f;*/
point.x = (pt->x + 0.5f) * xF + dRangeX[MIN] ;
point.y = (pt->y + 0.5f) * yF + dRangeY[MIN] ;
point.z = (pt->z + 0.5f) * zF + dRangeZ[MIN] ;
return (PtInRange(&point));
}
|
|
|
|

|
hi everybody,
when i draw a surface for example a trangle, just using 3 points, i just wonder why the the surface incudes the origin point (0,0,0) as a fourth point.
any ideal?
tia
Harald
|
|
|
|

|
hello,
is it possible to rotate the graph by pressing the button to a certain possition?
for example, i want to rotate the graph by pressing a button called "xy" in a view that only shows the 2d surface (xy)
tia
Harald
|
|
|
|

|
Hello!
Can someone help to me?
I need to make a surface from 2D data array containing the integer or double data.
I'm using this code:
////////////////////////////
void CDemoDlg::OnButton3()
{
m_Graph3D.ClearGraph();
m_Graph3D.SetCaption("Histogram");
double data,t[40];
double ar[50][255];
for(int ar_x=0;ar_x<50;ar_x++)
{
/* if(ar_x>20)
for(int ar_y=0;ar_y<255;ar_y++)
{
if(ar_y<127)
ar[ar_x][ar_y] = ar_y + rand()%3;
if(ar_y>=127)
ar[ar_x][ar_y] = 255-ar_y + rand()%3;
}
if(ar_x<=20)
*/ int ampl = (rand()%6+rand()%6+rand()%6)/3;
for(int ar_y=0;ar_y<255;ar_y++)
{
// if(ar_y<120)
ar[ar_x][ar_y] = sin(3.14*ar_y*(20+rand()%2))*ampl;
if(ar[ar_x][ar_y]<0)
ar[ar_x][ar_y]=0;
// if(ar_y>=120)
// ar[ar_x][ar_y] = sin(3.14*ar_y)*10;;
}
}
for (int i = 0; i < 50; i++)
for (int j = 0; j < 255; j++)
{
data = ar[i][j];//8 * exp(-(t[i] * t[i] + t[j] * t[j]) / 4);
m_Graph3D.AddElement();
m_Graph3D.SetElementType(i,2);
m_Graph3D.SetElementPointColor(i, RGB(0,0,100));
m_Graph3D.SetElementLineColor(i, RGB(200,50,50));
m_Graph3D.SetElementPointSize(i, 2.3);
m_Graph3D.PlotXYZ(j,data,i,i);
// m_Graph3D.SetElementType(j, 3);
}
m_Graph3D.AutoRange();
}
///////////////////////////////////
How to make the surface from this data array?
regards,
Georgi
|
|
|
|

|
Hi Friend,
this control is realy cool
|
|
|
|

|
Hey ,
I found this nice pice of software. And start to try it out,
but my problem is, that i can't register the ntgraph3d.dll to my windows 2000 system
I had read the 2d ActiveX description, for registration, but I can't solve the problem.
If I go to the folder in a command window and type regsvr32 ntgraph3d.dll
I got a windows messagebox with following message:
DllRegisterServer in ntgraph3d.dll failed.
Return code was 0x80040154
Anybody have an idea for this problem.
Best regardes
Eng
PS: Forgot: I use Visual Studio .Net 2003
|
|
|
|

|
Hey ,
I found this nice pice of software. And start to try it out,
but my problem is, that i can't register the ntgraph3d.dll to my windows 2000 system
I had read the 2d ActiveX description, for registration, but I can't solve the problem.
If I go to the folder in a command window and type regsvr32 ntgraph3d.dll
I got a windows messagebox with following message:
DllRegisterServer in ntgraph3d.dll failed.
Return code was 0x80040154
Anybody have an idea for this problem.
Best regardes
Eng
|
|
|
|

|
How to run 2 different(or same) OpenGL objects in one DialogBox?
IDC_STATIC1 is a first OpenGL objects Scene window.
IDC_STATIC2 is a second OpenGL objects Scene window.
IDC_STATIC1 and IDC_STATIC2 ,they are placed on IDD_DIALOG1.
code:
pclStatic = (CStatic *)GetDlgItem(IDC_OpenGL_Window);
pclGlView = new CGlView(pclStatic);
pclGlView->OnCreate();
pclGlView->InitGL();
pclGlView->DrawGLScene();
pclStatic1 = (CStatic *)GetDlgItem(IDC_OpenGL_Window);
pclGlView1 = new CGlView(pclStatic1);
pclGlView1->OnCreate();
pclGlView1->InitGL();
pclGlView1->DrawGLScene();
Will not involve both windows (IDC_STATIC2,IDC_STATIC1)
|
|
|
|
|

|
The source seems to throw a few errors when building on Microsoft Visual Studio .NET 2003. Any ideas?
c:\Documents and Settings\My Documents\Visual Studio Projects\NTGraph3D_src\GraphCtl.cpp(1143): error C2668: 'sqrt' : ambiguous call to overloaded function
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(626): could be 'long double sqrt(long double)'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(578): or 'float sqrt(float)'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\math.h(200): or 'double sqrt(double)'
while trying to match the argument list '(std::vector<_Ty>::size_type)'
with
[
_Ty=CPoint3D
]
|
|
|
|

|
Has anyone set line color in C#? I'm looking for the method that replaces RGB(...).
best regards,
|
|
|
|

|
Is it possible to stretch one axis for the purpose of viewing 3d data from an object which is in the shape of rectangle? The default axis is perfect for cube type data display but my application requires one axis to be stretched significantly to give the user a proper perspective. Any help will be greatly appreciated.
David
|
|
|
|

|
Hi I tried to use this control in WTL dialog based application generated by WTL Wizard. I simply put it in resource editor and when I try to run the application I got unhandled exception 0XC0000005. I tried the same in MFC and everything work just fine .So what is the problem ?
|
|
|
|

|
Hi..
I very interested with OpenGL programming ,so i need some help to learn more things about it, i need to learn how can work with joystics, how can i built a panl control ,please send to me an articles or notes or code or anything about this topics , then i will very greatful for you
|
|
|
|

|
Nice 3D Viewer !
I need a 3D printing like 2D graph...
I hope to get this function at next release...
han1963
|
|
|
|

|
Hi, i can not download the source code. Why?
Nice to see you here
|
|
|
|

|
Hi,
Basically a nice, useable control. The error messages are severely irritating though.
"Yo ho ho and a bottle of rum for that!"
"Your mother never allows you that!"
"Well I never ...!"
"You didn't say please first."
Leaves a very amateur flavour...
Mark
|
|
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
An ATL/STL ActiveX control based on OpenGL library for 3D data visualization
| Type | Article |
| Licence | |
| First Posted | 15 Jun 2003 |
| Views | 430,564 |
| Bookmarked | 254 times |
|
|