summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3djs
Commit message (Collapse)AuthorAgeFilesLines
* Add obscured / unobscured rendering togman@chromium.org2009-12-051-109/+209
| | | | | | | | | | | | | | | manipulators. I only did it on the rotate1 manipulators because it was easy. On the translate ones you either need to put each shape on it's own transform so you can set the parameters different or you need the materials to use different named parameters. Review URL: http://codereview.chromium.org/463025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33900 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes the compiled o3djs libraries.gman@chromium.org2009-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | The issue was that lineprimitves.js creates an object that inherits from something in primitives.js but because it appeared first in the compiled version the inherit command failed since the object it inherited from was not yet defined. It might be possible to make build_docs.py move all the inherit commands to the end of the compiled o3djs libs. I'll have to look into it. In the meantime here is a manual fix. Review URL: http://codereview.chromium.org/464030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33773 0039d316-1c4b-4281-b951-d872f2087c98
* Creates a CameraController class, and makes the Rotate1 manipulator use line ↵simonrad@chromium.org2009-12-033-56/+471
| | | | | | | | | | | | | | | | | geometry. - Creates a basic CameraController class. It allows the user to rotate the camera around a center position using the mouse, and outputs a view matrix. - Changes the Rotate1 manipulator to display as line geometry. Adds a line ring primitive and a special shader. - Merges changes to Rotate1 sample into Translate1+2 samples as well. We probably should refactor the samples so we don't have duplicate code. R=gman,kbr BUG=none TEST=none Review URL: http://codereview.chromium.org/465023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33747 0039d316-1c4b-4281-b951-d872f2087c98
* Updates the picking library to have a PickManager andgman@chromium.org2009-12-032-99/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* TBR=kbr@google.comgman@chromium.org2009-12-012-2/+2
| | | | | | | | | Fix for last CL I was testing in the wrong client :-( git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33388 0039d316-1c4b-4281-b951-d872f2087c98
* Make primitives and lineprimitives sharegman@chromium.org2009-11-302-131/+111
| | | | | | | | the implemtation of createShape Review URL: http://codereview.chromium.org/453010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33367 0039d316-1c4b-4281-b951-d872f2087c98
* Separate the line primitive stuff out of debug.jsgman@chromium.org2009-11-254-426/+491
| | | | | | | | | | | and into lineprimitives.js. I refactored to code to share a lot of stuff with primitive.js. Review URL: http://codereview.chromium.org/435039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33041 0039d316-1c4b-4281-b951-d872f2087c98
* Update the manipulator rotate1 example to usegman@chromium.org2009-11-253-41/+83
| | | | | | | | | | | | | | | | | | | | a separate transform graph and render graph from the main scene's. two more things 1) added a scale to one transform in the scene to show an issue with manipulators that might need to be fixed 2) changed the material used by the manipulators to be constant. This is on the path to making the manipulators be line primitives instead of geometry. Review URL: http://codereview.chromium.org/434060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33040 0039d316-1c4b-4281-b951-d872f2087c98
* Added new way of dragging the Rotate1 manipulator (linear mapping in screen ↵simonrad@chromium.org2009-11-241-55/+114
| | | | | | | | | | | space). BUG=none TEST=none Review URL: http://codereview.chromium.org/413007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32958 0039d316-1c4b-4281-b951-d872f2087c98
* Added torus primitive and Rotate1 manipulator.simonrad@chromium.org2009-11-202-34/+274
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/395012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32596 0039d316-1c4b-4281-b951-d872f2087c98
* Created o3djs Plane and Translate2 classes.simonrad@chromium.org2009-11-121-91/+458
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/382001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31841 0039d316-1c4b-4281-b951-d872f2087c98
* Made all line endings consistently LF and added svn:eol-style=LF property to ↵apatrick@google.com2009-11-123-1403/+1403
| | | | | | | | | | | | | | | | | | | | | | | | | | files with these names / extensions. c cc h mm txt idl py js html css gyp gypi xml shader json htm README DEPS git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31811 0039d316-1c4b-4281-b951-d872f2087c98
* Change build to only have one place to listgman@google.com2009-11-031-4/+1
| | | | | | | | | o3djs files and build / selenium to use compiled o3djs libs. Review URL: http://codereview.chromium.org/353017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30838 0039d316-1c4b-4281-b951-d872f2087c98
* Put back some scons files that the docs build parses, but rename themgspencer@google.com2009-11-031-0/+63
| | | | | | | | | with ".manifest", since we no longer have a scons build. We should probably change the code that parses these to be simpler someday. Review URL: http://codereview.chromium.org/341073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30774 0039d316-1c4b-4281-b951-d872f2087c98
* This change kills the SCons build, since we have switched completelygspencer@google.com2009-11-021-63/+0
| | | | | | | | | over to GYP. It also copies the contents of DEPS_gyp to DEPS, and removes the DEPS_gyp file. Review URL: http://codereview.chromium.org/354011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30729 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bugs in rendergraph.jsgman@google.com2009-10-201-2/+2
| | | | | | | | DrawPassInfo.destroy was not correctly deleting things. Review URL: http://codereview.chromium.org/297016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29567 0039d316-1c4b-4281-b951-d872f2087c98
* Removed workaround for Chrome 1.0 from o3djs library.apatrick@google.com2009-10-192-92/+65
| | | | | | | | Fix big causing Canvas sample to crash. Review URL: http://codereview.chromium.org/303008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29477 0039d316-1c4b-4281-b951-d872f2087c98
* Fix for canvas.drawBitmapgman@google.com2009-10-122-3/+5
| | | | | | Review URL: http://codereview.chromium.org/269055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28741 0039d316-1c4b-4281-b951-d872f2087c98
* Further doc improvements for Line_.closestPointToRay() based onkbr@google.com2009-10-061-11/+10
| | | | | | | | comments in http://codereview.chromium.org/251097 . Review URL: http://codereview.chromium.org/243111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28181 0039d316-1c4b-4281-b951-d872f2087c98
* Improved documentation for the derivation of Line_.closestPointToRay().kbr@google.com2009-10-061-1/+41
| | | | | | Review URL: http://codereview.chromium.org/251097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28132 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing bug #152 (pressing "T" doens't leave a trail in the particle samples ↵vangelis@google.com2009-09-261-4/+4
| | | | | | | | | | | | only in Chrome). The problem had to do with the translation of the key codes. There's another issue that surfaced with the event.js code in IE when the events are handled by methods running in V8. In that situation it appears that event.keyIdentifier isn't actually a string and IE barfs when we call keyIdent.indexOf(). I added a check to make sure it's a string but I don't know if the fix really belongs somewhere in the V8 / IE bridge Review URL: http://codereview.chromium.org/218002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27308 0039d316-1c4b-4281-b951-d872f2087c98
* A bunch of jscompiler fixes including updating togman@google.com2009-09-106-21/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the latest jscompiler. There were a few issues. For some reason o3djs.math.matrix4 was not working in ff3.0 when compiled. I spent about 8 hours trying to reproduce the issue in a small case but had no luck. I finally just tried changing original code and it work. In the process of trying to figure that out I got the latest jscompiler and found there were a bunch of other problems with our js code which are now fixed. Also found out I was incorrectly striping @o3dparameter tags from our code in build_docs.py Also, I learned that properties of objects are strings when returned in an "in" statement as in for (key in object) key is a string regardless of what each key is in object. Review URL: http://codereview.chromium.org/200089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25944 0039d316-1c4b-4281-b951-d872f2087c98
* remove bad trailing commagman@google.com2009-09-041-2/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25547 0039d316-1c4b-4281-b951-d872f2087c98
* Adding a no-binary path to the o3dConvertergman@google.com2009-09-041-40/+85
| | | | | | | | | | | | | | | | and deserializer. This CL still creates a o3dtgz file, it's just that buffers, skins and curves are stored in JSON instead of binary. I'm not sure how useful this is but it seemed like a possible short cut to testing out some stuff. Another CL will add some flag so there is no gzipped tar file, just the json. Review URL: http://codereview.chromium.org/189003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25523 0039d316-1c4b-4281-b951-d872f2087c98
* Beginnings of direct manipulator support in o3djs library. Addedkbr@google.com2009-09-022-2/+925
| | | | | | | | | | | | | Translate1 manipulator, which implements dragging along a line, and helper and base classes. This is a work in progress; feedback appreciated. Fixed problem in recently changed documentation in primitives.js. Minor documentation cleanup in primitives.html. Review URL: http://codereview.chromium.org/178044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25152 0039d316-1c4b-4281-b951-d872f2087c98
* Update samples to use more utility functions wheregman@google.com2009-09-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Bump version to 0.1.42gman@google.com2009-08-281-1/+1
| | | | | | | | | | This is partly so video can distinguish between 0.1.41 which they pushed internally and 0.1.42 which will be our next push. Review URL: http://codereview.chromium.org/179015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24782 0039d316-1c4b-4281-b951-d872f2087c98
* bug fixgman@google.com2009-08-271-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24592 0039d316-1c4b-4281-b951-d872f2087c98
* fix commentgman@google.com2009-08-251-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24354 0039d316-1c4b-4281-b951-d872f2087c98
* docs fixes for simple.jsgman@google.com2009-08-211-5/+12
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24018 0039d316-1c4b-4281-b951-d872f2087c98
* update deps to grab new pdiff and mac reference imagesgman@google.com2009-08-211-43/+320
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24014 0039d316-1c4b-4281-b951-d872f2087c98
* Changes the Windows backbuffer to RGBA mode.gman@google.com2009-08-211-3/+0
| | | | | | | | | | Note: This requires all new sample reference files which are in another CL and that requires a new pdiff which is in yet another CL Review URL: http://codereview.chromium.org/173182 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23983 0039d316-1c4b-4281-b951-d872f2087c98
* Add IO functions for Bitmap and change other utilitesgman@google.com2009-08-212-25/+142
| | | | | | | | | to use them. Review URL: http://codereview.chromium.org/174236 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23982 0039d316-1c4b-4281-b951-d872f2087c98
* Added o3djs.util.getElementsByTagAndId andgman@google.com2009-08-211-52/+127
| | | | | | | | | | | | | | | | o3djs.util.getO3DContainerElements which encasplulates the way we were finding elements to make O3D tags in. I also put an example of how to make your own failure callback in the docs. This also brought up a known issue in the doc generator so that fix is included here. Review URL: http://codereview.chromium.org/173178 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23976 0039d316-1c4b-4281-b951-d872f2087c98
* Generalized cylinder code in primitives.js to handle truncated cones.kbr@google.com2009-08-201-24/+175
| | | | | | | | | | | | o3djs.primitives.createCylinderVertices now delegates to createTruncatedConeVertices. Updated primitives.html. Added o3djs.primitives.VertexInfo.append to allow multiple VertexInfos to be placed in a single Shape for efficiency; this functionality has been tested but is not yet demonstrated in a sample. Review URL: http://codereview.chromium.org/174186 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23917 0039d316-1c4b-4281-b951-d872f2087c98
* Remove references to pack.createTextureFromRawDatagman@google.com2009-08-191-6/+6
| | | | | | | | as it has been deprecated. Review URL: http://codereview.chromium.org/173071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23727 0039d316-1c4b-4281-b951-d872f2087c98
* Additions of minor utility functions.kbr@google.com2009-08-191-0/+37
| | | | | | Review URL: http://codereview.chromium.org/173041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23689 0039d316-1c4b-4281-b951-d872f2087c98
* A bunch more docs fixesgman@google.com2009-08-199-107/+72
| | | | | | Review URL: http://codereview.chromium.org/171070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23679 0039d316-1c4b-4281-b951-d872f2087c98
* expose Bitmap to JavaScript.gman@google.com2009-08-196-14/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also added Texture.drawImage(canvas...) There's still the big question of whether we should flip textures by default in the o3d code. Currently I'm flipping them by default in o3djs.texture.createTextureFromRawData and I'm flipping them by default in o3djs.canvas.CanvasQuad.updateTexture. I'm torn whether or not I should be flipping them. I feel like 2d examples and examples of displaying images, like a picasa viewer, would be simpler if we didn't flip by default but the problem then is if you load some textures through a collada scene they'll be flipped the opposite of any textures you load by hand. Review URL: http://codereview.chromium.org/171060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23678 0039d316-1c4b-4281-b951-d872f2087c98
* Added default values to property documentation.gman@google.com2009-08-054-9/+9
| | | | | | | | Fixed a few more docs issues. Review URL: http://codereview.chromium.org/159894 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22463 0039d316-1c4b-4281-b951-d872f2087c98
* Asynchronous tick now uses NPN_PluginAsyncCall.URL streaming callbacks are ↵apatrick@google.com2009-08-031-3/+1
| | | | | | | | now also asynchronous.Implemented NPN_PluginAsyncCall for IE.Allowed WM_PAINT handler to be reentered because it no longer calls into the browser (except to schedule an asynchronous tick if none is pending).Fixed a bug where the EventManager would crash if an event callback called cleanUp on the client.Cleanup destroys all the packs. Doing this in NPP_Destroy seems to make Chrome timeout and fail to load the next page.Tar and GZ decoding happens on a new thread. Review URL: http://codereview.chromium.org/155733 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22305 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
* Changes to picking example to show how to getgman@google.com2009-07-282-14/+92
| | | | | | | | | | | the surface normal for the spot picked. Apparently no screenshots are taken for picking so no deps files need up be updated Review URL: http://codereview.chromium.org/159442 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21805 0039d316-1c4b-4281-b951-d872f2087c98
* This change fixes the issue that if you usegman@google.com2009-07-241-1/+13
| | | | | | | | | | | | | | | | | | | | | | o3djs.util.setMainEngine(...V8) in any sample and you use scripts that you don't want run in V8, for example Adsense, Google Analyitics, Wave, Google WebElements then the o3djs would attempt to pull in that javascript and execute it in V8. Specifically this refers to inline <script> tags instead HTML. Not <script src="url"> tags. The solution is we add an id to the tags we want o3djs to pull in. Any script with an id that starts with "o3d" will get pulled in. This CL changes our samples to have that id on their script tags. Review URL: http://codereview.chromium.org/159339 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21585 0039d316-1c4b-4281-b951-d872f2087c98
* o3djs.utils.makeClients checks that Renderer has been initialized.apatrick@google.com2009-07-211-1/+5
| | | | | | | | Prevents case where init callback is called before NPP_SetWindow (which initializes the renderer). Review URL: http://codereview.chromium.org/155716 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21188 0039d316-1c4b-4281-b951-d872f2087c98
* The compiled version of the o3djs libs WORK!gman@google.com2009-07-201-0/+8
| | | | | | | | | | | | | | | | | | | Sadly there is some really strange voodoo to make it work. util.js was using document.getElementsByTagName('script') and it was not returning all the scripts. Lots of dump() lines later the voodoo of calling document.getElementsByTagName('script').length (the length is important) in some place earlier in the code fixes the issue. Also, added the copyright to the compiled file Added parameter docs Review URL: http://codereview.chromium.org/159049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21085 0039d316-1c4b-4281-b951-d872f2087c98
* Added a new sample which implements basic shadow mapping.petersont@chromium.org2009-07-171-4/+20
| | | | | | Review URL: http://codereview.chromium.org/155401 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21000 0039d316-1c4b-4281-b951-d872f2087c98
* JSCompiler fixesgman@google.com2009-07-164-39/+137
| | | | | | | | | | | | | | | | | *) Generate goog.exportSymbol for all o3djs classes, methods and properties so the JSCompiler does not delete them *) Remove goog.exportSymbol from the compiled result. *) Remove o3djs.require from the compiled result. *) Add docs to undocumented items in o3djs. Review URL: http://codereview.chromium.org/155665 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20919 0039d316-1c4b-4281-b951-d872f2087c98
* Fix createCheckerMaterial to use same colors as it original used.gman@google.com2009-07-151-1/+1
| | | | | | | | | and increase timeout for Google IO step14ex. Also make old-school-shadows use createCheckerMaterial Review URL: http://codereview.chromium.org/155554 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20800 0039d316-1c4b-4281-b951-d872f2087c98
* minor fix for docsgman@google.com2009-07-131-2/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20556 0039d316-1c4b-4281-b951-d872f2087c98