google-code-export / o3d

Automatically exported from code.google.com/p/o3d
0 stars 0 forks source link

Drawing Primitive Shapes #184

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I want to put a plane, a cyclinder and a spher or second cyclinder into the
scene. But it is not putting the third one. I could not understand why? The
code is actually same with the examples.

  var redMaterial = o3djs.material.createBasicMaterial(g_pack, g_viewInfo,
[0.2, 1, 0.2, 1]);  // green      
  var redAtom   = o3djs.material.createBasicMaterial(g_pack, g_viewInfo,
[1.0, 0, 0.0, 1]);
  var greenAtom = o3djs.material.createBasicMaterial(g_pack, g_viewInfo,
[0.0, 1.0, 0.0, 1]);
  var blueAtom  = o3djs.material.createBasicMaterial(g_pack, g_viewInfo,
[0.0, 0.0, 1.0, 1]); 

  var checkerMaterial = o3djs.material.createMaterialFromFile(g_pack,
'shaders/checker.shader', g_viewInfo.performanceDrawList);

 // Create a ground plane.
  var shape = o3djs.primitives.createPlane(g_pack, checkerMaterial, 100,
100, 10, 10);
  var transform = g_pack.createObject('Transform');
  transform.parent = g_root;
  transform.addShape(shape);
// Create a cylinder.
  var shape = o3djs.primitives.createCylinder(g_pack, redMaterial, 2.5, 15,
20, 1, g_math.matrix4.translation([0, 2.5, 0]));
  var transform = g_pack.createObject('Transform');
  transform.parent = g_root;
  transform.addShape(shape); 

  var shape_2 = o3djs.primitives.createSphere(g_pack, redAtom, 4.5, 15, 25,
1, g_math.matrix4.translation(10, 8, 0));
  var transform = g_pack.createObject('Transform');
  transform.parent = g_root;
  transform.addShape(shape_2); 

What I have to do to draw different basic object into the scene?

Thanks in advance.

Original issue reported on code.google.com by sinan...@gmail.com on 5 Nov 2009 at 6:47

GoogleCodeExporter commented 9 years ago
Sorry but this is the wrong place to ask for support. Could you please submit 
your
question to the o3d discussion group?

http://groups.google.com/group/o3d-discuss?lnk=srg&hl=en

We'll be happy to help you there.

Original comment by g...@google.com on 5 Nov 2009 at 7:42