The objectives of my OpenGL library are the following:
- No external dependencies (except opengl.h)
- GPU-heavy: achieved with opengl3-core or gles 2 usage.
- Supports desktop and mobile devices.
- Cooperates with open-source tools like blender (3D) or inkscape (2D vector).
- Easy to use: The system leaves the OpenGL state-machine always in a usable condition. All objects are created with useful default values.
The Example
Create an object. Wait for the OpenGLView to “finish launching” and write your scene definition code. In this case
- (void) setupScene
{
NSString* probeName = @"Probe";
probe = [world createIngredient: probeName];
[probe setFlavour:Model3D];
[probe setModel:@"YAProbe"];
for(int i = 0; i <= 15; i++) {
YABasicAnimator* anim = [world createBasicAnimator];
[anim setProgress:harmonic];
[anim setDelay:0.07 * i];
probeId = [world createImpersonator: probeName];
YAImpersonator* imp = [world getImpersonator:probeId];
YAVector3f* rotate = [imp rotation];
[rotate setX:-90 - (15 * 0) ];
[rotate setY:180];
[rotate setZ:0.0f];
[anim addListener:[imp rotation] factor:360.0f];
YAVector3f* translate = [imp translation];
[translate setX:-23.0f + (3 * i)];
[translate setY:0.0f];
[translate setZ:70.0f];
}
}
Look over the shoulder
The complete development time of this example took about 10 minutes. Here is a shortcut to the final minute.