Add initial prototype.
This commit is contained in:
16
3-mid/opengl/applet/demo/camera/camera_demo.gpr
Normal file
16
3-mid/opengl/applet/demo/camera/camera_demo.gpr
Normal file
@@ -0,0 +1,16 @@
|
||||
with
|
||||
"opengl_demo",
|
||||
"lace_shared";
|
||||
|
||||
project camera_Demo
|
||||
is
|
||||
for Object_Dir use "build";
|
||||
for Exec_Dir use ".";
|
||||
for Main use ("launch_camera_demo.adb");
|
||||
|
||||
package Ide renames Lace_shared.Ide;
|
||||
package Builder renames Lace_shared.Builder;
|
||||
package Compiler renames Lace_shared.Compiler;
|
||||
package Binder renames Lace_shared.Binder;
|
||||
|
||||
end camera_Demo;
|
||||
69
3-mid/opengl/applet/demo/camera/launch_camera_demo.adb
Normal file
69
3-mid/opengl/applet/demo/camera/launch_camera_demo.adb
Normal file
@@ -0,0 +1,69 @@
|
||||
with
|
||||
openGL.Renderer.lean,
|
||||
openGL.Camera,
|
||||
openGL.Visual,
|
||||
openGL.Palette,
|
||||
openGL.Model.box.colored,
|
||||
openGL.Demo;
|
||||
|
||||
procedure launch_Camera_Demo
|
||||
--
|
||||
-- Exercise the camera.
|
||||
--
|
||||
is
|
||||
use openGL,
|
||||
openGL.Model,
|
||||
openGL.Model.box,
|
||||
openGL.Palette,
|
||||
openGL.Math,
|
||||
openGL.linear_Algebra_3d;
|
||||
|
||||
begin
|
||||
Demo.print_Usage;
|
||||
Demo.define ("openGL 'Camera' Demo");
|
||||
|
||||
-- Setup the camera.
|
||||
--
|
||||
Demo.Camera.Position_is ([5.0, 0.0, 10.0],
|
||||
y_Rotation_from (to_Radians (0.0)));
|
||||
|
||||
declare
|
||||
-- The Model.
|
||||
--
|
||||
the_box_Model : constant openGL.Model.Box.colored.view
|
||||
:= openGL.Model.Box.colored.new_Box (size => [0.5, 0.5, 0.5],
|
||||
faces => [front => (colors => [others => (Blue, Opaque)]),
|
||||
rear => (colors => [others => (light_Blue, Opaque)]),
|
||||
upper => (colors => [others => (Green, Opaque)]),
|
||||
lower => (colors => [others => (forest_Green, Opaque)]),
|
||||
left => (colors => [others => (Dark_Red, Opaque)]),
|
||||
right => (colors => [others => (Red, Opaque)])]);
|
||||
|
||||
the_Sprite : constant openGL.Visual.view
|
||||
:= openGL.Visual.Forge.new_Visual (the_box_Model.all'Access);
|
||||
|
||||
begin
|
||||
the_Sprite.Site_is ([10.0, 0.0, 0.0]);
|
||||
|
||||
-- Main loop.
|
||||
--
|
||||
while not Demo.Done
|
||||
loop
|
||||
Demo.Dolly.evolve;
|
||||
Demo.Done := Demo.Dolly.quit_Requested;
|
||||
|
||||
-- Render all sprites.
|
||||
--
|
||||
Demo.Camera.render (Visuals => [1 => the_Sprite]);
|
||||
|
||||
while not Demo.Camera.cull_Completed
|
||||
loop
|
||||
delay Duration'Small;
|
||||
end loop;
|
||||
|
||||
Demo.Renderer.render;
|
||||
end loop;
|
||||
end;
|
||||
|
||||
Demo.destroy;
|
||||
end launch_Camera_Demo;
|
||||
Reference in New Issue
Block a user