Skip to content
cjcliffe edited this page Apr 14, 2012 · 2 revisions

A collection of samples and demonstrations currently within the CubicVR GitHub repository.

Basic Cube, Manual RenderingBasic Cube

Rendering a simple Cube Mesh, manual rendering of the Mesh is performed 
using CubicVR.renderObject(). Basic Cubic UV Mapping is applied and 
rendering is performed in MainLoop.

Link to Example
Link to Source

Basic Cube with SceneBasic Scene

Rendering a Mesh using a SceneObject in a Scene. A Cube Mesh is bound
to a SceneObject and Scene is used to render it.

Link to Example
Link to Source

Basic Scene with View ControlBasic Scene with Mouse View Controller

Applying a MouseViewController to the Scene's Camera
to allow interaction.

Link to Example
Link to Source

Simple Torus using Lathe generatorLathe Generator

Using the lathe generator to produce a simple torus Mesh.

Link to Example
Link to Source

Basic Primitive GeneratorsPrimitive Generators

Using the CubicVR.primitives mesh generators, various example meshes.

Link to Example
Link to Source

WireframesWireframe

Creating and rending a wireframe of triangles or quads 
for any [[Mesh]] with optional wireframe material.

Link to Example
Link to Source

Basic MaterialsBasic Materials

Creating and applying various Material and UVMapper objects 
to primitives.

Link to Example
Link to Source

Cube with Multiple MaterialsCube with Multiple Materials

A single Cube Mesh with a different Material applied to each surface.

Link to Example
Link to Source

Discontinuous Sphere UV MappingSphere U,V Mapping

Example of experimental discontinuous U,V mapping, currently only 
applies to sphere mapping.

Link to Example
Link to Source

Catmull-clarkBuilt-in Catmull-Clark subdivision

Example of using Catmull-Clark subdivision (Mesh.subdivide) to
subdivide a simple cube (8 point) and lathe mesh (12x24 points x,y)

Link to Example
Link to Source

Subdivision beveled cubeUsing regular and Catmull-Clark subdivision to make a beveled cube

Example of using Catmull-Clark coupled with regular subdivision
to bevel a cube. Point colors and U,V are handled automatically.

Link to Example
Link to Source

Per-SceneObject Mesh material instancesMaterial Instances

Multiple SceneObjects using the same Mesh allowing each to have 
it's own instance of material properties.

Link to Example
Link to Source

Material UV offsetMaterial U,V Offset

Applying a U,V offset to the material to allow 'crawling' effects.

Link to Example
Link to Source

Material UV offsetLandscape (experimental)

Example of a CubicVR.Landscape providing height and orientation 
calculations for surface objects.

Link to Example
Link to Source

Procedural MeshCubicVR XML/JSON Mesh

The main ship from Flight of the Navigator in CubicVR XML and BF-JSON
Format loaded via CubicVR.loadMesh().

Link to Example
Link to Example JSON
Link to Source
Link to Source JSON


Procedural MeshCubicVR XML Procedural Mesh

A collection of simple procedural meshes defined in CubicVR XML Format
that can be loaded via CubicVR.loadMesh().

Link to Example
Link to Source

DefinitionsCubicVR Constructor Definitions

Example of using the implied CubicVR.[[get]] feature to supply an XML or JSON
file in place of a constructor. Recursive loading is supported and repeat
loads are managed with an internal cache.

Link to Example
Link to XML Example
Link to Source
Link to XML Source


PDF GalleryPDF Browser

A simple example using the PDF class and some mesh panels
to create a cool PDF browser.

Link to Example
Link to Source

MotionAnimation with the Motion class

Using the [[Motion]] class to apply animation to a [[SceneObject]].

Link to Example
Link to Source

Dynamic VBODynamic VBO: Wobbly Cube

Example of manipulating the vertex buffer (points and normals) after the
object has been compiled.  A simple sin/cos is applied to the vertices.

Link to Example
Link to Source

Dynamic VBODynamic VBO: Wave Pool

Applying a simple wave pool simulation to the surface of a landscape
using dynamic VBO support.  Interaction via mouse movement.

Link to Example
Link to Source

Basic Custom Shader MaterialBasic CustomShader Material

A simple CustomShader GLSL Material that performs a transform and adds
some surface color to the base material.

Link to Example
Link to Source

Custom Shader Material with perlin noiseCustomShader Material with Perlin noise

An example of a CustomShader GLSL Material that uses a simple perlin 
noise function and timer to create a RGB plasma type texture in 
real-time.

Link to Example
Link to Source

Using multiple camerasUsing multiple Cameras

Using multiple cameras within the same scene and switching 
cameras on cue.

Link to Example
Link to Source

Rendering a scene to a textureRendering a Scene to a Texture

Example of rendering a scene off-screen to another texture and using
that texture in the final render.

Link to Example
Link to Source

Shadowed spotlights and alpha materialsShadowed Spotlights

Four shadowed spotlights are cast upon a transparent crate object and
produce shadows on the floor below.

Link to Example
Link to Source

Post ProcessingPost-processing bloom and blur

The [[PostProcessChain]] is applied to a scene with a bloom shader loaded
and blur settings enabled.

Link to Example
Link to Source

Shadowed directional area lightShadowed Area Light

Example of using the Shadowed Area light to produce a shadow for a 
large area within the camera's view.  Area light adapts automatically 
to camera direction and orientation.

Link to Example
Link to Source

Shadowed spotlights attached to objectSpotlight Shadows attached to a SceneObject

Four shadowed spotlights are attached inside a transparent crate 
object and cast shadows on the enclosing room.

Link to Example
Link to Source

Shadowed spotlight attachment with projectorShadowed Spotlight with Projector

Four shadowed spotlights which also contain a projective texture 
are attached within a crate mesh.  Camera tracking is used to follow 
it around the room.

Link to Example
Link to Source

COLLADA - The DuckCOLLADA - Duck

A familar COLLADA duck loaded and rendered via CubicVR.js

Link to Example
Link to Source

COLLADA - SketchupCOLLADA - Sketch-Up

Loading and rendering a model created via Google Sketch-Up

Link to Example
Link to Source

VehicleCOLLADA Vehicle

Example of loading a vehicle from a COLLADA file and applying
some environment mapping and a cube map backdrop.

Link to Example
Link to Source

COLLADA - Wall smash baked physicsCOLLADA - Baked Physics

Example of using a COLLADA file created by baking the result of a 
Bullet physics simulation within Blender.

Link to Example
Link to Source

COLLADA - Wall smash baked physics with subdivisionCOLLADA - Applying subdivision to existing meshes

Example of the wall smash animation example with catmull-clark
and regular subdivision applied to smooth out the meshes.

Link to Example
Link to Source

COLLADA - Wall smash camera attachedCOLLADA - Camera attachment

The COLLADA Bullet example with the Camera manipulated to be attached
to the rolling ball.

Link to Example
Link to Source

VBO MorphingVertex Buffer Morphing

Example of generating Mesh morph targets and blending the animation
between them.  Uses fox model from Three.js ro.me demo.

Link to Example
Link to Source

VBO Morphing instancesVBO Morph Instances

Example of rendering many instances of Mesh morph targets at various
speeds and cycle offsets.  Uses fox model from Three.js ro.me demo.

Link to Example
Link to Source

Basic Physics TestBasic Physics Test

Simple test of dropping a dynamic rigid cube on a static one.

Link to Example
Link to Source

Physics Collision shapesPhysics Collision Shapes

Test of various dynamic collision shape primitives dropped onto a 
static floor.

Link to Example
Link to Source

Physics Stress-testPhysics Stress Test

A simple example of dropping many collision primitives to
test performance.

Link to Example
Link to Source

Physics mouse picking and interactionInteractive Physics

Using ray-casts for accurate surface picking.  Utilizes constraints 
to allow precise physical interaction via the mouse.

Link to Example
Link to Source

Physics compound Collision shapesCompound Collision Shapes

Compounding a collection of Collision shape primitives to form more
complex structures.

Link to Example
Link to Source

Physics simple test of Zero-GZero-G Physics

A simple test of ray interaction in a Zero-G environment.

Link to Example
Link to Source

Physics Zero-G tether experimentZero-G constraint experiment

A simple test of connecting two objects via constraint in a Zero-G 
physics environment.  Click two points to add a constraint between
the objects.

Link to Example
Link to Source

Physics First-person grappling experiment with dynamic asteroidsFirst-person grappling experiment with dynamic convex hulls

A first-person grappling experiment utilizing convex hulls to represent
dynamic and static asteroid meshes.  W and S keys provide thrust, click
an asteroid to grapple to it.  When grappled press 'G' to toggle gravity 
boots. Drag view to look.

Link to Example
Link to Source

Physics and Event based first-person shooter type exampleFirst-person-shooter example with Events

A simple first-person shooter experiment.  Events are handled via the 
CubicVR.Event system built-in to the Scene class allowing a simple 
Key and Door gameplay mechanic.

W,A,S,D for walking and drag the mouse to look.

Link to Example
Link to Source

Project: BeatDetektor Audio ExampleBeatDetektor and Mozilla Audio API Demo

An example of using beatdetektor.js and the Mozilla Audio API to
create a simple 3D audio demonstration.

Any .ogg file can be dragged into the window to play it or just press
play for the default track.

Link to Example
Link to Source

Clone this wiki locally