Page 1 of 2

NXC GL

Posted: 26 Dec 2010, 18:21
by dudmaster
I have been working on some 3D lately, and i thought to post them. They are powered by gl in NXC.

Here you can learn about how to create 3D graphics on an NXT, watch a video of my PSP-Nx 3D in action, and download them to your NXT!

How gl Works
glInit(); Initialize the gl library, this always comes first
glBox(gl mode, gl sizeX, glsizeY, glsizeZ); create an object with the variables in sizes
glCube(gl mode, gl size); create an object with the variable in size
glPyramind(); I do not yet understand
glSet(setting type, setting value) Set
glSetAngleX(value); set the angle X to value
glSetAngleY(value); set the angle Y to value
glSetAngleZ(value); set the angle Z to value
glAddToAngleX(value); Add the angle X by value
glAddToAngleZ(value); Add the angle Z by value
glAddToAngleY(value); Add the angle Y by value
glObjectAction(Object ID, action, value); Preform an object action
glCallObject(object ID); Call object to be rendered
glBeginRender(); Begin render
glFinishRender(); Clear screen, rotate objects, finish render
More NXC Commands Guide
My PSP-Nx 3D
This is a program that uses GL and the PSP controller to operate:
[also includes example GL programs, and PSP-Nx 3D demo]
video coming soon!
gl.zip
UPDATE 1
(2.54 KiB) Downloaded 451 times

Re: NXC GL

Posted: 26 Dec 2010, 21:01
by enzymex
Wow, very impressive. I’ve never encountered 3D programming on the NXT, so this was an eye-opener. Thank you very much for sharing, it is definitely appreciated.

Re: NXC GL

Posted: 26 Dec 2010, 23:51
by dudmaster
Your welcome. It is a great way to do graphics.

Re: NXC GL

Posted: 27 Dec 2010, 00:45
by dudmaster
AND- download the new version. It is an update to PSP-Nx 3D.

Re: NXC GL

Posted: 27 Dec 2010, 23:05
by nxtboyiii
The glPyramid is glPyramid(int glMode, int glSizeX, int glSizeY, int glSizeZ); Input the size of the X, Y, and Z axis of the pyramid. Creates a pyramid.

Re: NXC GL

Posted: 28 Dec 2010, 16:15
by dudmaster
Yes, i have already tried that. I forgot what it did. I think it gave me a "File Error" It gave me an error in NXTDefs.h

Re: NXC GL

Posted: 29 Mar 2011, 23:25
by stryker001
I could use some help, I'm getting errors when I use the glObjectAction(0, GL_ROTATE_OBJECT...) function (SCALE and TRANSLATE work, but ROTATE crashes the NXT....)

Re: NXC GL

Posted: 08 May 2011, 15:54
by dudmaster
Really? I never tried the ROTATE command... :?

Re: NXC GL

Posted: 23 Jul 2011, 00:11
by stryker001
yes really.

Re: NXC GL

Posted: 23 Jul 2011, 02:44
by dimasterooo
Hey idk/ don't have NXC, so I can't try it :(. Could someone upload a video of it, cuz it sounds really cool :)