My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
OMARExamples  
This is a collection of examples showcasing the OMAR scripting API.
Updated Feb 26, 2010 by megah...@hypercosm.com

OMAR Scripting Examples

The following are a set of examples demonstrating the features of the OMAR scripting API. The actual live demos use compiled OMAR code, but each example also has a link so you can download or view the source code that was used to create the demo.

Software Required

To make use of the examples below, you will need the following software:

Additional References

The following are sources of additional information to help you get started using the OMAR programming language and Hypercosm Studio software:




Basics

The following examples show some very basic aspects of scripting such as how to create simple shapes and animation.

Welcome

download project

This applet is an introduction to Hypercosm scripting. It demonstrates how to create shapes, how to apply materials, and how to view shapes in animations.

Primitives

download project

This applet demonstrates the shape and parameters of each of the primitive shapes.

Simple Animation

download project

This applet demonstrates simple animation using a bouncing ball. This simulation demonstrates the physics of bouncing and friction. Clicking on the applet with the mouse restarts the ball bouncing.

Input Devices

The following demos are used to demonstrate how to use the mouse, keyboard, and joystick functions.

Mouse

download project

This applet demonstrates how to query the mouse location and mouse buttons by displaying a virtual mouse which mimics the behavior of your real mouse. The virtual mouse moves across the plane following your mouse and the mouse buttons depress and highlight when you click your mouse buttons.

Keyboard

download project

This applet demonstrates how to use the keyboard functions by displaying a virtual keyboard. The virtual keyboard responds to your key presses by highlighting and depressing the simulated keys as you press your real keyboard keys.

Joystick

download project

This applet demonstrates how to use the joystick functions by displaying a virtual joystick. The virtual joystick responds to the X-Y motions of the real joystick, the throttle, and also the joystick button presses.

Interaction

The following examples show how to use the mouse to virtually touch and manipulate objects in your scene.

Picking

download project

Picking is the most basic type of user interaction and allows you to determine when your mouse cursor is over a particular shape in the scene.

Manipulators

download project

Manipulators allow you to grab an object and move or reorient it using direct manipulation. When you move your mouse over an object, a set of "handles" are shown which you can then grab and drag to change the location or orientation of an object in the scene.

Text

Text is essential for many applications to give feedback to the user. There are a number of different types of text and text may be positioned in different ways with respect to the window or with respect to the scene.

Overlay Text

download project

Overlay text displays 2D text in screen coordinates relative to the window . Overlay text is frequently used to display status messages that are not tied to a particular object and is always overlayed on top of objects in the 3D scene.

Label Text

download project

Label text is 2D text that is placed at a 3D location in the scene. It's used when you want to the text to be tied to a particular 3D object or location.

Renderable Text

download project

Renderable text is text that is drawn in perspective within the three dimensional scene. Since renderable text needs to be rendered as a 3D object, it takes more work for your computer's processor to display than overlay text, so it should only be used when the text absolutely needs to be in 3D.

Materials

Materials are used to define the surface attributes and appearance of objects.

Material Configurator

download project

This material configurator lets you configure a material and view the results. This applet lets you choose between a common material type (chalk, plastic, metal, glass) and to vary the color, shininess, and other material parameters.

Blue Marble

download project

This example demonstrates advanced use of materials including bump mapping for mountainous terrain, gloss mapping for ocean surfaces, transparency (alpha) mapping for the clouds, and emissive mapping for city lights.

Physics

Hypercosm incorporates a physics engine (Bullet), which lets you create 3D worlds that not just look real, but act real as well.

Physics Primitives

download project

The physics engine requires that you describe the scene geometry in terms of a set of basic shapes called "physics primitives". This example shows how to do that using the block, sphere, cylinder, and capsule physics primitives.

Physics Compound Shape

download project

Physics compound shapes are used to combine multiple shapes into a single object that behaves as a unit rather than as a collection of separate objects.

Physics Constraints

download project

Physics constaints let you constrain the motion of objects in different ways. For example, an object might be constrained to rotate about its hinges, to slide along a track or to hang from a rope.

Physics Force and Torque

download project

The physics engine allows to to apply forces and torques to objects and they will respond to Newton's laws according to their mass, position, friction and other physical attributes.

Physics Mesh

download project

The physics mesh allows you to simulate the physics of objects with any arbitrary shape. Normally, it's best to try to use a simpler proxy shape such as a sphere or cube in place of a complex mesh, but in some cases an object may have a shape that's not easily approximated by a simple geometric proxy.

Physics Scenes

download project

Physics scenes allow you to divide the physical simulation into multiple groups of non-interacting components. This is useful both for performance reasons and also as a way of controlling the physical behavior of the simulation when you want to isolate a physical behavior to a subset of the scene.

Physics Vehicle

download project

The physics engine has specific support for simulating vehicles since they are a popular type of object to include in games and physical simulations.

Data Files

The following examples show examples of parsing and displaying data from external data sources.

XML Scene Graph Parser

download project

This applet shows how to parse and display an XML file. This example uses a simple scene graph schema to parse and display 3D scenes containing shapes, transformations, and materials.

Text File PDB Viewer

download project

This applet shows how to parse a text file. This example uses a text file in the Protein Data Bank (PDB) format to parse and display a molecular model.


Sign in to add a comment
Powered by Google Project Hosting