Google Code offered in: English - Español - 日本語 - 한국어 - Português - Pусский - 中文(简体) - 中文(繁體)
These demos show typical applications and games you can create with O3D:
|
Beach Scene (17MB)
|
|
Prince IO: The SketchUp Knight
|
|
|
|
To run an example, click its description. The complete set of examples can be downloaded as a zip archive.
|
Your introduction to a O3D program. Loads a scene and displays it. Moves a 3D object. |
|
|
Creating a cube, adding colors, adding textures. These samples are discussed in detail in the Program Structure, Shapes, Materials, and Textures chapters of the Developer's Guide. |
|
|
Using the o3djs.simple utility library This example uses the |
|
|
This example includes text boxes that allow you to manually set the eye position, target, and up vector of the camera. |
|
|
This example demonstrates using the |
|
|
Creating simple shapes using the primitives utility library This example demonstrates using the |
|
|
(a) Create a sphere with a Phong shader. (b) Create a light. (c) Add normals and vertex streams. |
|
|
Test one of the 12 shaders included in this example The samples directory contains a number of common shaders you can use for the effects in your programs. |
|
|
Sobel edge detection shader This example shows how to use render targets to create a Sobel edge-detect image processing shader. |
|
|
Displaying a juggling pattern using a shader This example uses shaders to create an animation of juggling balls. The JavaScript program includes a variable for the time. Using a mathematical function for the trajectory of the balls, the shader checks whether a given pixel is contained in the ball at a given moment. If YES, the ball color is used for that pixel. If NO, the background color is used for that pixel. |
|
|
Drawing an animated julia set in real time using the pixel shader for the computation (7 KB) This example is similar to the juggling example. It uses the pixel shader to compute where the shape pixels are at any given time. |
|
|
Converting image color space and format This example shows how to use a shader to perform image color space and format conversion. |
|
|
This example demonstrates the use of sampler state settings and how they affect the way that textures are mapped onto geometry. |
|
|
O3D supplies a default error texture when a texture is missing or improperly specified. This example shows how you can use the |
|
|
This example shows how to create a Lambert-shaded checkerboard texture programmatically within a shader and how to apply this texture to a model imported from a file. |
|
|
Creating a small texture using JavaScript This example creates seven textures programmatically. Each texture is in a different format (XRGB8, ARGB8, ABGR16F). |
|
|
Loading textures from a .tgz archive This example progressively loads textures from a tar.gz archive. |
|
|
This example shows how to create bitmaps and how to draw images on both bitmaps and texture mipmaps. |
|
|
1000 teapots created from a grid of transforms, each with an instance of the same teapot shape. |
|
|
How to override effect params on instanced geometry This example uses a single instanced sphere, changing the color of each sphere by specifying the parameters for the effect on the transform for each sphere instance. |
|
|
This example creates a 10-by-10 grid of O3D frames, sets up the DrawContext and effect for each frame, and then loads a rotating cube into each. |
|
|
This example illustrates setting the client's render mode to |
|
|
This example sets up three views, each with a viewport, a tree traversal, and two draw passes. The left and top-right views use a perspective projection, and the bottom-right view uses an orthographic projection. |
|
|
Creating a shadow map (multi-pass rendering) This example uses two render passes to render shadows. The first pass renders the scene from the perspective of the light to create an offscreen, grayscale image called the shadow map. In the second pass, which renders the transform graph, the pixel shader samples the shadow map to determine if a point is in shadow. |
|
|
Creating shadows using a simple circle texture This example uses a single quad with a round texture and draws it under the object.
The only "trick" is that you need to draw the shadows last (on a separate draw pass). Turn off z-buffer writing and use the |
|
|
Z-sorting for transparent objects This example creates a rotating grid of transparent spheres. The material is added to the |
|
|
This example shows computing and display frames per second for a vertex-shaded cube. |
|
|
This example shows use of bounding boxes and the CULLING state parameter to render only elements that are visible on the screen. |
|
|
This example illustrates a technique for loading complex textures in an unobtrusive way. First a low-resolution blue sphere is loaded for the Earth's surface, followed by a series of progressively higher resolution textures: daytime Earth, then nighttime Earth, and finally Earth with reflective oceans. |
|
|
This example shows how to set up a basic render graph that uses RenderSurface nodes to implement render targets. |
|
|
2D image processing using render targets This example uses a convolution shader to create a 2D Gaussian blur. The same code can be used for any separable convolution kernel. |
|
|
This example modifies the Hello, World example to toggle between plug-in and full-screen modes. |
|
|
This example sets up animation curves that are evaluated by the O3D plug-in to create motion without executing any JavaScript functions. |
|
|
This example shows a simple skinned cylinder. |
|
|
Scene with an animation (717Kb) This example shows an animated model. |
|
|
Using the particles.js utility library This example illustrates using the GPU for particle effects such as fire, smoke, and rain. |
|
|
This example shows creating a ripple effect using the vertex shader. |
|
|
This example shows using the vertex shader to move the vertices in a sine wave based on the parameter "time" and the world position of the vertices. |
|
|
Billboard objects simulating 3D objects This example shows how to create 2D objects that appear three-dimensional because they always face the camera. |
|
|
This example demonstrates how to display 2D graphics with O3D. This technique provides better rendering performance for 2D rendering than basic HTML. |
|
|
This example shows the Box2DJS physics engine in 3D. |
|
|
Creating a heads-up display or 2D overlay This example includes two ViewInfo objects: one for the normal 3D view and one for the heads-up display (HUD). The view for the HUD has a higher priority than the view for the 3D objects, so the HUD view is drawn after the 3D view. The HUD view does not clear the buffer between renderings. Each view displays different branches of the transform graph. |
|
|
Using the Canvas object for 2D drawing This example demonstrates use of the Canvas API. |
|
|
This example demonstrates using the Canvas object to create text with different fonts. |
|
|
This example demonstrates drawing into a Canvas surface using a texture. |
|
|
This example uses the O3D utility library |
|
|
Home Configurator (Firefox only) This example uses models from 3D Warehouse and demonstrates how an application can combine HTML and O3D on the same page. The user drags and drops items from an HTML furniture catalog and positions them in an O3D model home. |
|
|
This interactive version of checkers demonstrates picking and simple animation. |
|