Difference between revisions of "Castle Game Engine"

From Free Pascal wiki
Jump to navigationJump to search
(+ Kambi VRML game engine page)
 
(* mention "ProcessEvents := true" call)
Line 11: Line 11:
 
== Lazarus components ==
 
== Lazarus components ==
  
We have two components for now: TKamOpenGLControl (simple descendant of standard TOpenGLControl) and TKamVRMLBrowser (descendant of TKamOpenGLControl that allows you to load any 3D model, and acts as VRML browser). If your game is fully contained within a single VRML model, and you just want to "execute" it, then TKamVRMLBrowser component is for you. You just drop this on the form, call it's Load(FileName) method, and you're done. Animations work, rendering in OpenGL works, navigation and key/mouse sensors work, etc.
+
We have two components for now: TKamOpenGLControl (simple descendant of standard TOpenGLControl) and TKamVRMLBrowser (descendant of TKamOpenGLControl that allows you to load any 3D model, and acts as VRML browser). If your game is fully contained within a single VRML model, and you just want to "execute" it, then TKamVRMLBrowser component is for you. You just drop this on the form, from code you call
 +
 
 +
<code>
 +
  Browser.Load(FileName);
 +
  Browser.Scene.ProcessEvents := true;
 +
</code>
 +
 
 +
and you're done. Animations work, rendering in OpenGL works, navigation and key/mouse sensors work, etc.
  
 
To install Lazarus components, download the engine sources, and see inside "<tt>packages/</tt>" directory. You probably want to install packages <tt>(unix|windows)/kambi_units.lpk</tt> and <tt>components/kambi_components.lpk</tt>.
 
To install Lazarus components, download the engine sources, and see inside "<tt>packages/</tt>" directory. You probably want to install packages <tt>(unix|windows)/kambi_units.lpk</tt> and <tt>components/kambi_components.lpk</tt>.

Revision as of 06:18, 16 October 2008

Features

Kambi VRML game engine allows you to render 3D models in various formats. In particular, support for VRML / X3D format is very versatile. You can define animations, interactions, scripting, shaders and many more in VRML/X3D, so you get quite capable 3D game engine in the end.

Rendering is done through OpenGL. We can use OpenGL context initialized in any way, including Lazarus TOpenGLControl component, our own TGLWindow class (which allows you to create windows with OpenGL context, menu bars and dialog boxes, completely without the LCL), or any other library capable of creating GL context (glut, SDL).

The engine homepage is http://vrmlengine.sourceforge.net/. In particular, this page lists all the engine features.

Engine is open-source (GNU GPL >= 2), developed in nice object-oriented way, only for FPC/Lazarus (everything is in objfpc mode).

Lazarus components

We have two components for now: TKamOpenGLControl (simple descendant of standard TOpenGLControl) and TKamVRMLBrowser (descendant of TKamOpenGLControl that allows you to load any 3D model, and acts as VRML browser). If your game is fully contained within a single VRML model, and you just want to "execute" it, then TKamVRMLBrowser component is for you. You just drop this on the form, from code you call

 Browser.Load(FileName);
 Browser.Scene.ProcessEvents := true;

and you're done. Animations work, rendering in OpenGL works, navigation and key/mouse sensors work, etc.

To install Lazarus components, download the engine sources, and see inside "packages/" directory. You probably want to install packages (unix|windows)/kambi_units.lpk and components/kambi_components.lpk.

For more examples, see inside engine sources --- look for "examples" subdirectories. For example VRML browser done with Lazarus, see inside kambi_vrml_game_engine/3dmodels.gl/examples/lazarus_vrml_browser/ directory. Full API reference and more high-level documentation about VRML handling are available.

Enjoy! Author: Michalis Kamburelis