-
Notifications
You must be signed in to change notification settings - Fork 103
Examples and demos
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.
→ Link to Example
→ Link to Source
⌘ Basic 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 Mouse View Controller
Applying a MouseViewController to the Scene's Camera
to allow interaction.
→ Link to Example
→ Link to Source
⌘ Lathe Generator
Using the lathe generator to produce a simple torus Mesh.
→ Link to Example
→ Link to Source
⌘ Primitive Generators
Using the CubicVR.primitives mesh generators, various example meshes.
→ Link to Example
→ Link to Source
⌘ Wireframe
Creating and rending a wireframe of triangles or quads
for any [[Mesh]] with optional wireframe material.
→ Link to Example
→ Link to Source
⌘ Basic Materials
Creating and applying various Material and UVMapper objects
to primitives.
→ Link to Example
→ Link to Source
⌘ Cube with Multiple Materials
A single Cube Mesh with a different Material applied to each surface.
→ Link to Example
→ Link to Source
⌘ Sphere U,V Mapping
Example of experimental discontinuous U,V mapping, currently only
applies to sphere mapping.
→ Link to Example
→ Link to Source
⌘ Built-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
⌘ Using 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
⌘ Material 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 U,V Offset
Applying a U,V offset to the material to allow 'crawling' effects.
→ Link to Example
→ Link to Source
⌘ Landscape (experimental)
Example of a CubicVR.Landscape providing height and orientation
calculations for surface objects.
→ Link to Example
→ Link to Source
⌘ CubicVR 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
⌘ CubicVR 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
⌘ CubicVR 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 Browser
A simple example using the PDF class and some mesh panels
to create a cool PDF browser.
→ Link to Example
→ Link to Source
⌘ Animation with the Motion class
Using the [[Motion]] class to apply animation to a [[SceneObject]].
→ Link to Example
→ Link to Source
⌘ Dynamic 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 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 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
⌘ CustomShader 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 Cameras
Using multiple cameras within the same scene and switching
cameras on cue.
→ Link to Example
→ Link to Source
⌘ Rendering 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
Four shadowed spotlights are cast upon a transparent crate object and
produce shadows on the floor below.
→ Link to Example
→ Link to Source
⌘ Post-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 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
⌘ Spotlight 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 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 - Duck
A familar COLLADA duck loaded and rendered via CubicVR.js
→ Link to Example
→ Link to Source
⌘ COLLADA - Sketch-Up
Loading and rendering a model created via Google Sketch-Up
→ Link to Example
→ Link to Source
⌘ COLLADA 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 - 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 - 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 - Camera attachment
The COLLADA Bullet example with the Camera manipulated to be attached
to the rolling ball.
→ Link to Example
→ Link to Source
⌘ Vertex 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 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 Test
Simple test of dropping a dynamic rigid cube on a static one.
→ Link to Example
→ Link to Source
⌘ Physics Collision Shapes
Test of various dynamic collision shape primitives dropped onto a
static floor.
→ Link to Example
→ Link to Source
⌘ Physics Stress Test
A simple example of dropping many collision primitives to
test performance.
→ Link to Example
→ Link to Source
⌘ Interactive Physics
Using ray-casts for accurate surface picking. Utilizes constraints
to allow precise physical interaction via the mouse.
→ Link to Example
→ Link to Source
⌘ Compound Collision Shapes
Compounding a collection of Collision shape primitives to form more
complex structures.
→ Link to Example
→ Link to Source
⌘ Zero-G Physics
A simple test of ray interaction in a Zero-G environment.
→ Link to Example
→ Link to Source
⌘ Zero-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
⌘ First-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
⌘ First-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
⌘ BeatDetektor 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.