PDA

View Full Version : glVertex3f(x,y,z) internal function



alneam
08-04-2012, 04:22 PM
hello everybody....
I have a problem in understand the internal function of { glVertex3f(x,y,z) } and how it is work ??
and can I enter the internal library of opengl to view how this function working??

thanks in advance....

mhagain
08-05-2012, 07:13 AM
What part of it are you having difficulty with?

The exact implementation of glVertex3f depends on your driver. No, you can't view any source code for it, because OpenGL is not open source (and nor is it software).

alneam
08-05-2012, 06:56 PM
thanks Mhagain for your quick response...
I have a difficulty with the projection that used in this function, because i tried to Plot 3D Points onto a 2D screen .
where the very useful and quick way to draw 3D point onto the screen is:
x_screen = x_3D / z_3D;
y_screen = y_3D / z_3D;

but the results on the screen is not the same results that produce by { glVertex3f } , so i need to understand the type of projection in this function to do like it..

thanks in advance

mbentrup
08-06-2012, 01:46 AM
You can look at the source of the gluProject function, which does the correct transformation, here: http://cgit.freedesktop.org/mesa/mesa/tree/src/glu/sgi/libutil/project.c#n233

alneam
08-06-2012, 05:21 AM
You can look at the source of the gluProject function, which does the correct transformation, here: http://cgit.freedesktop.org/mesa/mesa/tree/src/glu/sgi/libutil/project.c#n233

but i used glut library in visual c++ 2008 , I think it differ .