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

|
Have you checked the exact name of the control in Access? If yes, have you then tried writing NTGraph3D0.Object instead of just NTGraph3D0 (or whatever your control`s name was) in the With line of the Torus example? Torus example with this .Object modification works fine in Access for me.
|
|
|
|

|
please tell me how to change the grid distances of x & y axis in ntgraph activex control.
abhinav bhorkar
|
|
|
|

|
Hi,
I've been using VBA for some time but have never worked with ActiveX controls.
I am trying to use this ActiveX Control in Excel.
I have registered the dll using REGSVR32.
I created an ActiveX control using NTGraph3D class.
I can see the empty x,y,z axis in the control.
I double-clicked on the control to add code.
I have ensured that I've ticked "NTGraph3D 1.0 Type Library" in my project References.
I can see the NTGraph3D objects when I open the object browser.
I have created the following test code:
Sub TstTorus()
Dim Gr As OLEObject
Dim WS As Worksheet
Set WS = Worksheets("Sheet1")
WS.OLEObject("NTGraph3D").ClearGraph
End Sub
I keep getting the same compile error:
Object library invalid or contains references to object definitions that could not be found.
Is there some step that I've missed? I would greatly appreciate help!
bd
|
|
|
|

|
I want to use 2d capabilities of Direct3D. I have different bitmaps and need to blit these directly on 'Backbuffer of device'. I created a surface using IDirect3Device::CreateOffScreenPlainSurface() then I blit bitmap on this surfsace using GetDC() function of surface. Then I used IDirect3Device::GetBackBuffer() method to get backbuffer surface and using IDirect3Device::StretchRect(), did blit on backbuffer surfaceBut It did not work. Kindly guide me in this regard.
Raheel
modified on Saturday, September 6, 2008 7:46 AM
|
|
|
|

|
I want to move a point(x,y,z) on straight or curved path in NTGraph3D control. Should I use line drawing function to draw curved path? Can Grid in background be made invisible? I only need 3-Axis in background. Is there anyother free 3D-Graph Drawing Actvx control like NTGraph3D?
Thanks
Raheel
|
|
|
|

|
Anyone got the surface plot and associated properties to work or is it disabled? Any idea on how to get the release version? No valid contact details are available for the author here.
|
|
|
|
|

|
I found this 3D Graph ActiveX Control in this website, but I don't konw how to use it?
what is m_Graph3D then? it seems to be a instance of the class.
Any one who has used it, please give me one hint.
thanks.
|
|
|
|

|
Hi
I tryed your code in an MFC DLL and it worked, but very slow.
I have to show every 12Hz new 3D images.
Now i can display 1 Image per second and this will bring the CPU to 100%.
Ok what i have done is calling an function from the Dialog with this code:
m_Graph3D.AddElement(); // fügt ein Element hinzu
m_Graph3D.put_ElementType( 0 , 1); // definiert dasd ELement als Punkt
m_Graph3D.put_ElementPointSize( 0, 10.0); // setzt die Punktgröße
//m_Graph3D.put_ElementPointColor( 0 , ( ((unsigned long)((unsigned char)(piPixel/20 + 100))<<16) + ((unsigned short)((unsigned char)(piPixel/10))<<8))) ;
for (i = 0; i < height; i++)
{
for (j = 0; j < width; j++)
{
piPixel = *piData++;
m_Graph3D.PlotXYZ(j,i,piPixel, slElementID );
}
}
m_Graph3D.put_TrackMode( 2 );
m_Graph3D.AutoRange();
But this takes so much times and only every second Image will be shown
Can u help be to make it faster?
|
|
|
|

|
Hi
I registerd this dll and ntgraoh.ocx in win 3000 server but when I want to put it on my prog not only a new form it takes a long time and my prog can not be started my prog is in vc++.net windows form application .
please help me to say what can I do?
|
|
|
|

|
Hi All,
Can anyone tell me what changes required other than registering dll, i have to made while using NTGraph3D dll in Vista system
-- modified at 4:22 Friday 17th August, 2007
NSRS
|
|
|
|

|
Hey all,
sorry i'm pretty average at this VB business, currently using VB6 though. Downloaded the NTGraph3D binary and registered it using regsvr32 and all went well. However after adding as a component in VB only NTGraph3D's properties show up, the elements (ie ClearGraph, AddElement, ElementType) don't appear in the objects properties box. As such the given code example refuses to work.
Have downloaded, registered and successfully used the 2D version of NTGraph and i'm not entirely sure where i've gone wrong.
Any help much appreciated,
Mike
|
|
|
|

|
Hi, first off, thanks for making this, its been really helpful. i have been having problems plotting an iterative sequence of a lattice like structure using a scatter diagram. while the program is running only the corners of the cube appear then the rest is plotted at the end. yet if the code is run a second time all the points are plotted. is there a way this could be fixed?
manythanks again.
Ollie
|
|
|
|

|
Is anything other than registering NTGraph3D.dll required to get the control to work in Access?
I have it registered adn working with Excel.
Right now Access is a no go though.
Any help will be greatly appreciated
|
|
|
|

|
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
|
|
|
|
|
|

|
I'm working on a football game project using C# programming language.i finished the first part which is the part of the project,now i'mworking on the second part which viewing the game in 3D. so i need a 3D graphics library that can be linked to my project. thanks for your interest.
|
|
|
|

|
I'm working on afootball game project using c, a finished the first part of the project which is the core of it, and i'm working on the second part which " view the game in 3D".
i need a 3D library that can be usefull, and can be linked to a c# project.
|
|
|
|

|
Is there a way to save the graph to a JPEG file?
|
|
|
|

|
I have written a control similar to yours. Our application involves the rendering of a complex surface which can take many seconds. Our OnDraw code is like yours: it re-renders the entire scene.
What I'd like to do is to store the rendering so that uncovering the window, say, causes a redraw from the stored picture instead of starting again from scratch.
I've tried using the following instead of SwapBuffers after rendering the surface:
int viewport[4];
glGetIntegerv(GL_VIEWPORT, viewport);
glReadBuffer(GL_BACK);
glDrawBuffer(GL_FRONT);
glCopyPixels(viewport[0], viewport[1], viewport[2], viewport[3], GL_COLOR);
- so that the back buffer remains intact (the docs say that SwapBuffers leaves the back buffer undefined) and effectively stores the rendering. To redraw, I just do the same again (but without rendering first).
This works so long as I don't move the window around the screen.
Is there an 'approved' way of doing this?? Is what I'm doing 'safe'? Thanks in advance.
Phil Atkin
Synoptics Ltd., Cambridge, UK
|
|
|
|

|
First, using namespace std; in a header-file might may break others' code. Now, this is COM-component and COM wraps away all C++ specifics so this is not a problem here.
I just think it's good practice not to write using namespace std in a header-file.
Second, stl-classes and algorithms might throw exceptions. A COM-method may not propagate exceptions. Therefore it's usually a good idea to do something like this in all COM-methods:
STDMETHODIMP CGraphCtl::AddElement()
{
try
{
CElement Element ;
m_ElementList.push_back(Element);
SetDirty(TRUE);
return S_OK;
}
catch(...)
{
return E_FAIL;
}
}
I usually end up making macros for the try...catch pair as the catch part might be quite talkative.
And if you are addind try...catch I believe it's a good idea to add try...catch to all of these methods as well.
OnPaint
OnCreate
OnDestroy
OnLButtonDown
OnLButtonUP
OnMouseMove
OnSize
OnEraseBackground
Third, I think it's a good thing what you've done but since you asked for OpenGL pointers, I'd though I point out some COM-issues as well.
Ps. It doesn't provide any neat features but the code will be more robust.
Ps. Again good work.
/Mårten
|
|
|
|

|
Does anybody help me?
xinhua xia
|
|
|
|

|
FIRST OF ALL,TNANKS A LOT FOR Nikolai Teofilov'S COOL ACTIVEX AND EXCELLENT WORK, I HAVE EAGER TO FIND SUCH CONTROL FOR SEVERAL DAYS. BUT I MET A PROBLEM WHEN USE THE ACTIVEX.
WHEN I EXECUTE THE FOLLOWING CODE,A MESSAGEBOX FOR ERROR SHOW THAT "THE ACTIVX OBJECT CAN'T BE CREATED". BUT I HAVE MAKE A REFERENCE OF THE NTGRAPH.DLL.WHY THIS HAPPEN?
THANKS FOR ANY HELP AND ADVISE!
Set s = CreateObject("NTGRAPH3DLib.NTGraph3D ")
With s
.ClearGraph
.AddElement
.Caption = "Torus"
.ElementType(0) = 3 'Draw Surface
For i = 0 To 41
ti = (i - 20#) / 20# * 3.15
For j = 0 To 41
tj = (j - 20#) / 20# * 3.15
x = (Cos(tj) + 3#) * Cos(ti)
y = Sin(tj)
z = (Cos(tj) + 3#) * Sin(ti)
.PlotXYZ x, y, z, 0
Next
Next
.AutoRange
End With
"
|
|
|
|

|
That's a pretty cool control.
I've done similar work but in Delphi using GLScene.
You can check out my app (open-source under the Mozilla Public Licence).
http://gldata.sourceforge.net
Cheers,
Aaron
|
|
|
|

|
How about adding a method to add all the data in one go?
for example
AddElements(VARIANT varXData, VARIANT varYData, VARIANT varZData) where each VARIANT is a VT_ARRAY | VT_DOUBLE of n elements for n points. This would then let you plot all your data in a single COM call.
Just a thought.
|
|
|
|
|

|
A simple butterfly made from a broken klein bottle and original torus code
void CMy3DGraphDlg::OnKlein()
{
m_Graph3D.SetCaption ("Klein");
m_Graph3D.SetCaptionColor(RGB(255,127,127));
double x,y,z,ti,tj,hold1, holdm;
m_Graph3D.ClearGraph();
for (int i = 0; i < 41; i++)
{
ti = (i - 20.0)/20.0 * 3.15;
for (int j = 0; j < 41 ; j++)
{
tj = (j - 20.0)/20.0 * 3.15;
hold1 = sin(tj);
holdm = cos(ti*.5) * hold1 - sin(ti*.5)*sin(tj*2);
x = holdm * cos(ti);
y = holdm * sin(ti) *.5;
z = sin(ti*.5)* hold1 + cos(ti*.5) * sin(tj*.5);
m_Graph3D.AddElement();
m_Graph3D.SetElementLineColor(i, RGB(255,0,0));
m_Graph3D.SetElementType(i, 1);
m_Graph3D.SetElementPointColor(i, RGB(0,0,255));
m_Graph3D.SetElementPointSize(j, 3.5);
m_Graph3D.PlotXYZ(x,y,z,j);
}
}
m_Graph3D.AutoRange();
}
So much fun.
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
 |
|
|
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 | 431,423 |
| Bookmarked | 255 times |
|
|