Jump to content


Holy Shitballs!


  • You cannot reply to this topic
2 replies to this topic

#1 Mortikhi

    Ganking PK

  • Administrators
  • PipPip
  • 119 posts

Posted 28 May 2009 - 07:52 AM

http://startupearth.com/2009/05/28/a-deepe...oogles-o3d-api/

Be sure to watch the movie

With the advent of HTML5 adoption just around the corner, and the announcement of Google Labs’ open source 3D graphics API, “O3D”, we will soon be seeing a wave of visually rich, media-centric web applications that will change the way you interact with the web.

O3D is a Javascript API which allows developers to create 3D applications within the browser. It uses a browser plug-in that allows for complex, hardware accelerated scenes to be rendered in a <div> element, or a <canvas>, which users can then interact with in real-time.


The Beach Demo shows a complex scene rendered in the browser.

Google describes O3D as a response to the need for developers to create graphics-intensive products like Quake Live, and Microsoft Virtual Earth 3D, citing major drawbacks in current solutions on offer, such as the lack of cross-platform support in single-purpose plug-ins, and the need to install a separate plug-in for each product - both of which seem to have been overcome in O3D.



#2 bonedead

    PK for Life

  • Administrators
  • PipPipPip
  • 808 posts
  • Location:Sarasota, FL

Posted 28 May 2009 - 10:22 AM

Holy Shitballs indeed! I wonder how difficult it will be to make a simple scene. Say a beach with waves that come in and go back out. I'm assuming...

Well I just went to the Hello Cube demo page (which I can't view because my work comps gfx card blows) and viewed page source. It seems like it's going to be pretty complicated. Not so much complicated as time consuming, but I can't even imagine a game, much less a multiplayer game.

Here's a bit of the code that just creates the cube.
QUOTE
<script type="text/javascript">
o3djs.require('o3djs.util');
o3djs.require('o3djs.math');
o3djs.require('o3djs.rendergraph');

// Events
// Run the init() function once the page has finished loading.
// Run the uninit() function when the page has is unloaded.
window.onload = init;
window.onunload = uninit;

// global variables
var g_o3d;
var g_math;
var g_client;
var g_pack;
var g_clock = 0;
var g_timeMult = 1;
var g_cubeTransform;
var g_finished = false; // for selenium testing

/**
* Creates an O3D shape representing a cube. The shape consists of
* a single primitive with eight vertices and 12 triangles (two for each face
* of the cube).
* @param {o3d.Material} material the material used by the primitive.
* @return {o3d.Shape} The Shape object created.
*/
function createCube(material) {
// Create a Shape object for the mesh.
var cubeShape = g_pack.createObject('Shape');

// Create the Primitive that will contain the geometry data for
// the cube.
var cubePrimitive = g_pack.createObject('Primitive');

// Create a StreamBank to hold the streams of vertex data.
var streamBank = g_pack.createObject('StreamBank');

// Assign the material that was passed in to the primitive.
cubePrimitive.material = material;

// Assign the Primitive to the Shape.
cubePrimitive.owner = cubeShape;

// Assign the StreamBank to the Primitive.
cubePrimitive.streamBank = streamBank;

// The cube is made of 12 triangles. There's eight vertices in total which
// are shared between the face triangles.
cubePrimitive.primitiveType = g_o3d.Primitive.TRIANGLELIST;
cubePrimitive.numberPrimitives = 12; // 12 triangles
cubePrimitive.numberVertices = 8; // 8 vertices in total

// Generate the draw element for the cube primitive.
cubePrimitive.createDrawElement(g_pack, null);

// Create a javascript array that stores the X, Y and Z coordinates of each
// of the 8 corners of the cube.
var positionArray = [
-0.5, -0.5, 0.5, // vertex 0
0.5, -0.5, 0.5, // vertex 1
-0.5, 0.5, 0.5, // vertex 2
0.5, 0.5, 0.5, // vertex 3
-0.5, 0.5, -0.5, // vertex 4
0.5, 0.5, -0.5, // vertex 5
-0.5, -0.5, -0.5, // vertex 6
0.5, -0.5, -0.5 // vertex 7
];

// The following array defines how vertices are to be put together to form
// the triangles that make up the cube's faces. In the index array, every
// three elements define a triangle. So for example vertices 0, 1 and 2
// make up the first triangle, vertices 2, 1 and 3 the second one, etc.
var indicesArray = [
0, 1, 2, // face 1
2, 1, 3,
2, 3, 4, // face 2
4, 3, 5,
4, 5, 6, // face 3
6, 5, 7,
6, 7, 0, // face 4
0, 7, 1,
1, 7, 3, // face 5
3, 7, 5,
6, 0, 4, // face 6
4, 0, 2
];


lolwut

I can't even imagine how long the source would be for games or a crazy interactive landscape.

Very cool and very exciting stuff though. I always wondered when shit would start getting crazy on the internet, soon I would say.

#3 Nubs

    PK for Life

  • Administrators
  • PipPipPip
  • 312 posts
  • Gender:Male
  • Location:California
  • Interests:MMA, PC Gaming, My woman.

Posted 01 June 2009 - 12:25 AM

Looks pretty cool. I bet many free MMORPG's are right around the corner.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users