07-03-2009 11:57 AM
Hi,
I have a 3d viewer that uses the opengl control to display mathematical forms.
The base functions work fine as long as I use only the function panel controls.
My question is can I use api calls like glRotatef(...) and if so then is there some magic enable I need to call to display the results?
I'd like to use other things too.
If this is too deep for this board no worries.
I've been working on this one as an addon for quite awhile....
Tia,
CMM.
07-06-2009 07:35 PM
I'm not super familiar with opengl used in CVI but looking at the function tree the glrotatef is not part of the Tree(http://zone.ni.com/reference/en-XX/help/370051M-01/toolslib/toolslibopenglcontrol_functiontree/). Also If you look at the following document it does not look like low-level opengl codes are available through the instrument driver provided in LabWindows/CVI. (http://digital.ni.com/public.nsf/allkb/D369558F34AA3264862565FC007CBB33).
I would therefore conclude that you are unable to call glrotatef()but again this is at first glance of the function calls and the use of those particular Opengl Function calls.
07-07-2009 07:24 AM
Hi, I looked again and it seems that with the available calls I should be able to do what I want, but as yet no joy.
The thing I need/want is to be able to complete the display of my 3d graph from the other rotation angle. I cannot get the control to display the perspective I desire. ( I could describe it exactly if you wish)
No combination of Latitude and longitude seem to enable my perspective, thus the glrotate() call. Is it possible to include in the function panel popup rotation about arbitrary axes?. It would be helpful.
Tia.
CMM.
07-08-2009 08:26 AM
I'm back again,
here is a little more (I'm using CVI 6.0 here, I have CVI 9.0 at work)
I convert a picture control to OpenGl function panel form
draw3dcontrol = OGLConvertCtrl (drawPanel, DRAWPANEL_CANVAS);
// Now I ask for the HWND, the HDC and the HRC
OGLGetCtrlAttribute (drawPanel, draw3dcontrol, OGLATTR_HWND, &oglHwnd);
OGLGetCtrlAttribute (drawPanel, draw3dcontrol, OGLATTR_HDC, &oglHdc);
OGLGetCtrlAttribute (drawPanel, draw3dcontrol, OGLATTR_HRC, &oglRC);
//these return with valid responses which I assume are the window handle to the ogl control, the device context and the rendering context
//if I call
hglDC = wglGetCurrentDC();
hglrc = wglGetCurrentContext(); //
both previously uninitialized values return here as NULL ? why?
If I'm being annoying just let me know.
Thanks,
CMM
07-09-2009 03:16 PM
Codym,
I don't know why its returning Null values however you should be able to call the glrotatef opengl by calling the Open gl Dll. This is done here in this site for c and c++, you should be able to do the same thing in CV: http://www.codeproject.com/KB/openGL/OpenGL3DNavigation.aspx.
To call DLLs in CVI please refer to the following Developer's Zone article and EPD.
EPD: http://zone.ni.com/devzone/cda/epd/p/id/6151
Devzone: http://zone.ni.com/devzone/cda/tut/p/id/8503
This might help you get the perspective you need!
good luck!