Library for simple objects in OpenGL for Lazarus.
Setup - Setting up the OpenGLControl.
MakeSquare - Create a square of one color by declaring width, height and layer.
MakeCube - Create a cube of one color by declaring width, height, and depth.
MakePyramid - Create a pyramid of one color by declaring coordinate maxima - will be changed soon.
If you want to use this library in your projects, please credit me.
- Copy loplib.pas into your project folder.
- Inside the units in which you want to use LOpLib, add "LOpLib" to the end of your "uses" declaration at the top of the unit.
- To use a LOpLib method, write loplib.methodname or LOpLib.methodname. E.g.: loplib.MakeSquare(1, 1, 1, 0, 0, 1);
Setup(r, g, b);
Setting up the scene. The parameters define the background color.
r - REAL - Amount of red color
g - REAL - Amount of green color
b - REAL - Amount of blue color
MakeSquare(width, height, r, g, b, layer);
Creates two-dimensional square. The parameters define the form, color and layer.
width - REAL - Width of square on x
height - REAL - Height of square y
r - REAL - Amount of red color
g - REAL - Amount of green color
b - REAL - Amount of blue color
layer - REAL - defines which object is on top of another. Useful when there are multiple two-dimensional objects over each other. The highest layer is over every other layer
MakeCube(width, height, depth, r, g, b);
Creates cube. The parameters define the form and color.
width - REAL - Width of cube on x
height - REAL - Height of cube on y
depth - REAL - Depth of cube on z
r - REAL - Amount of red color
g - REAL - Amount of green color
b - REAL - Amount of blue color
MakePyramid(right, left, up, down, front, back, r, g, b);
Creates pyramid. The parameters define the form and color.
right - REAL - X coordinate of bottom right edge
left - REAL - X coordinate of bottom left edge
up - REAL - Y coordinate of pyramid peak vertice
down - REAL - Y coordinate of bottom face
front - REAL - Z coordinate of bottom front edge
back - REAL - Z coordinate of bottom rear edge
r - REAL - Amount of red color
g - REAL - Amount of green color
b - REAL - Amount of blue color