summaryrefslogtreecommitdiffstats
path: root/o3d/samples/checkers.html
Commit message (Collapse)AuthorAgeFilesLines
* Changed how checkers sample identifies whether a hit occurred usingkbr@google.com2010-05-281-2/+4
| | | | | | | | | | | | | | | clientId rather than object equality. In both Safari and Chrome, if the browser's JavaScript engine is used rather than O3D's embedded V8, these equality comparisons fail. It looks like we may need to disable the use of the embedded V8 for this sample due to bad interactions with event dispatching. BUG=none TEST=none Review URL: http://codereview.chromium.org/2334001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48451 0039d316-1c4b-4281-b951-d872f2087c98
* TBR=kbr@google.comgman@chromium.org2009-12-031-5/+5
| | | | | | | | I missed one of your comments in the last CL Review URL: http://codereview.chromium.org/464009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33636 0039d316-1c4b-4281-b951-d872f2087c98
* Updates the picking library to have a PickManager andgman@chromium.org2009-12-031-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support both not picking invisible objects and the option to pick even if invisible. The idea is you can do something like this // Make a picking manager var pm = o3djs.picking.createPickManager(rootTransform); ... // add a bunch of transforms. // generate picking objects. pm.update(); // Get the picking object that was created for some specific transform var info = pm.getTransformInfo(someTransform); // Set properties on that object related to picking info.pickEvenIfInvisible = true; I think this is just a first step. How an object should be defined as pickable is up for debate. As it is, you can basically override info.isPickable. as in info.isPickable = function() { // do something custom. } You can also start adding things easier like info.onPick = function() { // do something. } and then write code like info = pm.pick(worldRay); if (info) { info.onPick(); } While you could have done that before there was no easy way to find a the TransformInfo for a specific Transform. Now you can use PickManager.getTransformInfo Review URL: http://codereview.chromium.org/452027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33632 0039d316-1c4b-4281-b951-d872f2087c98
* Update samples to use more utility functions wheregman@google.com2009-09-011-32/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | appropriate. A few places used pseudoRandom. That is in math.js now so they use that. Other places there is now o3djs.material.createBasicMaterial and o3djs.material.createMaterialFromFile that save 10-20 lines per sample. This CL will require new reference images. There are 2 other things I'd like to consider. #1) Changing every sample that uses shaders/texture-only.shader to use o3djs.material.createConstantMaterial or some variation. The problem with o3djs.material.createConstantMaterial is it requires you pass it a texture if you want a constant textured material. All the samples create the material first, then later add the texture. So, I could add a new o3djs.material.createTextureOnlyMaterial. At the same time that would mean changing those samples from setting stuff on 'texSampler0' to 'emissive' #2) I'd like to change the shader builder so it stops adding "Sampler" to textured materials. As it is if the material uses a color it makes the param called "diffuse" but if it's a texture it makes it "diffuseSampler". That sucks because it means the code has to do crap like var param = material.getParam('diffuse'); if (param) { // it's a color } else { param = material.getParam('diffuseSampler'); if (param) { // it's a texture. } } If we stopped that silliness we could just do var param = material.getParam('diffuse'); if (param) { if (param.isA('o3d.ParamTexture')) { // it's textured. } else { // it's not. } } Unfortunately to fix this requires changing the o3dConverter as well since it uses those conventions. Should we do this? Review URL: http://codereview.chromium.org/182024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25015 0039d316-1c4b-4281-b951-d872f2087c98
* Change <script id="o3d" to <script id="o3dscript"gman@google.com2009-07-281-1/+1
| | | | | | | | | so that document.getElementById('o3d') will work for finding the o3d div. Review URL: http://codereview.chromium.org/159556 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21924 0039d316-1c4b-4281-b951-d872f2087c98
* This is the O3D source tree's initial commit to the Chromium tree. It gspencer@google.com2009-05-271-0/+895
is not built or referenced at all by the chrome build yet, and doesn't yet build in it's new home. We'll change that shortly. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17035 0039d316-1c4b-4281-b951-d872f2087c98