[x3d-public] Beginner questions
Michalis Kamburelis
michalis.kambi at gmail.com
Tue Jan 15 11:35:08 PST 2019
Leonard Daly <Leonard.Daly at realism.com> wrote:
> 4) Is it possible to make GAMES, or other, interactive 3D, in it? eg. like Quake or something, when the "up" key is pressed, it has to go *forward* - can X3D do that??
>
> Michalis Kamburelis has done a lot in this area with his Castle Game Engine. He is on this list and I hope responds here.
>
The short answer is: of course you can make games using X3D :)
That said, for creating non-trivial games (or any applications, in
fact), you will need some place to put/code application logic. This
code may start small, but gets large for larger games. E.g. moving in
Quake is easy -- you just modify the camera in response to input
(which you can implement in various ways, or you can even use the X3D
"WALK" navigation (available out-of-the-box in X3D players) to do the
job). But programming Quake enemies (bots), or programming network
synchronization to enable multi-player shooter, is substantially more
work :) There are two approaches for coding in X3D:
1. Use X3D Script node, which can be placed in an X3D scene. This way
your game is contained "inside" an X3D file, and you can use any
language allowed in X3D Script node (most browsers allow JavaScript
aka ECMAScript).
2. Or use an engine that "wraps" X3D.
Like my Castle Game Engine ( https://castle-engine.io/ ). CGE is
using X3D as one of our most advised 3D/2D model formats (
https://castle-engine.io/creating_data_model_formats.php ), as well as
our "scene graph" (so you can build or modify the scene at runtime, by
changing X3D nodes and fields). And we "wrap" X3D scenes in
higher-level concepts, so that you can operate on them from Object
Pascal code, you can load models / run animations / add user interface
from Object Pascal code. (Soon to be released Castle Game Engine 6.6
will also include a visual editor, which should eventually be like
Unity :) ). Many of these things are underneath implemented by
transforming X3D graph (e.g. all scenes are X3D graphs, even when
loaded from glTF or Spine; all animations are X3D animations), but in
many cases you don't need to know that, you use a higher-level API. An
example how does it look like is on
https://castle-engine.io/manual_scene.php .
Regards,
Michalis
More information about the x3d-public
mailing list