Examples and demos
Clone this wiki locally
A collection of samples and demonstrations currently within the CubicVR GitHub repository.
⌘ Basic 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.
Rendering a Mesh using a SceneObject in a Scene. A Cube Mesh is bound to a SceneObject and Scene is used to render it.
Applying a MouseViewController to the Scene's Camera to allow interaction.
Using the lathe generator to produce a simple torus Mesh.
Using the CubicVR.primitives mesh generators, various example meshes.
Creating and rending a wireframe of triangles or quads for any [[Mesh]] with optional wireframe material.
Creating and applying various Material and UVMapper objects to primitives.
A single Cube Mesh with a different Material applied to each surface.
Example of experimental discontinuous U,V mapping, currently only applies to sphere mapping.
Example of using Catmull-Clark subdivision (Mesh.subdivide) to subdivide a simple cube (8 point) and lathe mesh (12x24 points x,y)
Example of using Catmull-Clark coupled with regular subdivision to bevel a cube. Point colors and U,V are handled automatically.
Multiple SceneObjects using the same Mesh allowing each to have it's own instance of material properties.
Applying a U,V offset to the material to allow 'crawling' effects.
Example of a CubicVR.Landscape providing height and orientation calculations for surface objects.
The main ship from Flight of the Navigator in CubicVR XML and BF-JSON Format loaded via CubicVR.loadMesh().
A collection of simple procedural meshes defined in CubicVR XML Format that can be loaded via CubicVR.loadMesh().
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.
A simple example using the PDF class and some mesh panels to create a cool PDF browser.
Using the [[Motion]] class to apply animation to a [[SceneObject]].
Example of manipulating the vertex buffer (points and normals) after the object has been compiled. A simple sin/cos is applied to the vertices.
Applying a simple wave pool simulation to the surface of a landscape using dynamic VBO support. Interaction via mouse movement.
A simple CustomShader GLSL Material that performs a transform and adds some surface color to the base material.
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.
Using multiple cameras within the same scene and switching cameras on cue.
Example of rendering a scene off-screen to another texture and using that texture in the final render.
Four shadowed spotlights are cast upon a transparent crate object and produce shadows on the floor below.
The [[PostProcessChain]] is applied to a scene with a bloom shader loaded and blur settings enabled.
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.
Four shadowed spotlights are attached inside a transparent crate object and cast shadows on the enclosing room.
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.
A familar COLLADA duck loaded and rendered via CubicVR.js
Loading and rendering a model created via Google Sketch-Up
Example of loading a vehicle from a COLLADA file and applying some environment mapping and a cube map backdrop.
Example of using a COLLADA file created by baking the result of a Bullet physics simulation within Blender.
Example of the wall smash animation example with catmull-clark and regular subdivision applied to smooth out the meshes.
The COLLADA Bullet example with the Camera manipulated to be attached to the rolling ball.
Example of generating Mesh morph targets and blending the animation between them. Uses fox model from Three.js ro.me demo.
Example of rendering many instances of Mesh morph targets at various speeds and cycle offsets. Uses fox model from Three.js ro.me demo.
Simple test of dropping a dynamic rigid cube on a static one.
Test of various dynamic collision shape primitives dropped onto a static floor.
A simple example of dropping many collision primitives to test performance.
Using ray-casts for accurate surface picking. Utilizes constraints to allow precise physical interaction via the mouse.
Compounding a collection of Collision shape primitives to form more complex structures.
A simple test of ray interaction in a Zero-G environment.
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.
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.
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.
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.