ASTGL
Tutorials :: Creating scene

Engine and its systemsinitialized and now we shall create the simple scene with Camera, Light and Object. To create the mesh, do following:

ObjectMesh *mesh = new ObjectMesh("model.amdl", Vec3(10, 10, 10));

It will load mesh model from "data/meshes/model.amdl" and scale it 10 times.
Now add object to scene:

Scene::get()->addObject(mesh);

Now we shall add first person camera to scene:

CameraFPS *camera = new CameraFPS(Vec3(0, 0, 0), 100, 60);
camera->setPhysics(Vec3(5, 5, 5), 10);

Scene::get()->setCamera(camera);

And lighting:

Scene::get()->setAmbient(new EffectLightAmbient(Vec3(0.4, 0.4, 0.4)));
Scene::get()->addEffect(new EffectLightOmni(Vec3(1.0, 1.0, 1.0), Vec3(40, 65, 0), 200, true));

Hosted by uCoz