Hello,
Is it possible to setup a 3D point Array in VB 6 and pass it to an OpenGL Function.
For example I have setup the following Array:
Public Type Grid3D
x As GLfloat
y As GLfloat
z As GLfloat
End Type
Dim Grid3D1(3) As Grid3D
Grid3D1(0).x = XMin3D '-2#
Grid3D1(0).y = YMin3D '-2#
Grid3D1(0).z = ZCoord3D(0, 0) '0
Grid3D1(1).x = XMin3D
Grid3D1(1).y = YMax3D
Grid3D1(1).z = ZCoord3D(0, GlnRowCount - 1)
Grid3D1(2).x = XMax3D
Grid3D1(2).y = YMin3D
Grid3D1(2).z = ZCoord3D(GlnColumnCount - 1, 0)
Grid3D1(3).x = XMax3D
Grid3D1(3).y = YMax3D
Grid3D1(3).z = ZCoord3D(GlnColumnCount - 1, GlnRowCount - 1)
Now I want to pass to glMap2f to setup a grid
'Pass Control Points to OPenGL
glColor3f 1#, 1#, 1#
glEnable GL_MAP2_VERTEX_3
glMap2f GL_MAP2_VERTEX_3, XMin3D, XMax3D, 4, 2, YMin3D, YMax3D, 2 * 4, 2, Grid3D1(0)
'GridRows And Columns
glMapGrid2f RowCount, 0#, 1#, ColumnCount, 0#, 1#
'Render Grid
glEvalMesh2 GL_LINE, 0, RowCount, 0, ColumnCount
I get an error By Ref Arugument Mismatch.
If I pass a single variable Grid3d1(0).x I avoid the error but do not pass all the 3d points. There must be some other way to setup and pass a 3D point array in VB 6?
I am using VB OPenGL API Type Library ANSI for VB 6.