so its basically adding and subtracting one from each and all.
so the formula would be for z=0
point 1 = (x-1,y-1,z)
point 2 = (x+1,y+1,z)
point 3= (x+1,y-1),z)
point 4= (x-1,y+1, z)
point 5 - 8 = same as above but add z+1 to all
but the problem is that the coordinate in the array represent the location of the centre of the voxel so i cant do x-1 else that would give the point of another voxel not corner of the voxel
so how about instead of adding and subtracting 1, add and subtract 0.5
would this work.
also what opengl draw function can i use and how do i use it with the list of points i have.
It's never just one function to display stuff with OpenGL. IMO GLUT uses really weird syntax for a C\C++ style library, you have to define each point of your shape with function glVertex3f. The number in bold tells GLUT how many dimensions the shape has and the italicized letter tells it what data type the points are defined in, in that case it would be three dimensions because of the '3' and it would know to treat the numbers as floating point integers because of the 'f'. Each collection of points that define an individual shape have to be (bracketed?) between the glBegin() and glEnd() functions. Remember that OpenGL is just a standard to talk to the hardware, in order to actually see your shapes you need to use yet another library such as SFML (http://www.sfml-dev.org/) in which case you would display them with the sf::Window.Display() function.
As it is only temporary I like glvertex3f and glbegin they work really well as i tested it.
i have a question for people who know glbegin and glend
its regarding glutMainLoop
i don't know where to put it.
below is my pseudocode for my program
while loop loop through all frames in the webcam
detect corner in image
calibrate camera using corners
find projection points of 3d points
build 3d array from the projection poins
loop through the array to get x,y,z values of elements which are 1
pass the list to drawscene
glut handler functions glutdisplay, glutkeyboard, glutreshape
show original image
show segmented image
end while loop
using final 3d array implement marching cubes
which gives new list of vectors made up of triangle points connecting
render that aswell
pass vector to drawscene
call glut handler functions display, keypress, reshape
i placed it where i think it should be
i don't know if it is the correct place to put it.