NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
glScaleDemo.nxc

This is an example of how to use the glInit, glBox, glSetAngleX, glAddToAngleY, glBeginRender, glCallObject, glObjectAction, and glFinishRender functions.

/*-----------------------------------------------------------------------------
; File : glScaleDemo.nbc
; Description : A program demonstrating a scaling action...
; Programmed by : Arno van der Vegt, avandervegt@home.nl
;-----------------------------------------------------------------------------*/
int scaleX, scaleXStep;
task main()
{
// Initialize the 3D engine...
glInit();
// Create a box, this is the first object which will be object id 0...
glBox(GL_POLYGON, 20, 20, 20);
// Set the main view x-angle...
// Initialize the scaling vars...
scaleX = 256;
scaleXStep = 16;
while (true)
{
// Rotate the main view....
// Setup for rendering...
// Call the object with id 0...
// Finish, clear the screen, rotate and render the called objects...
// Scale between 256..512...
scaleX += scaleXStep;
if (scaleX >= 512)
scaleXStep = -16;
else if (scaleX <= 256)
scaleXStep = 16;
}
}