Canvas 3d JS Library

WebGL made easy!
  • rss
  • What is C3DL?
  • Download
  • Tutorials
    • Tutorial #1: WebGL Browsers
    • Tutorial #2: A simple scene
    • Tutorial #3: Callback
    • Tutorial #4: Models
    • Tutorial #5: Light effects
    • Tutorial #6: Picking
  • Development News
  • Documentation
  • Community
  • Resources
  • Contact
  • About
As agreed on in the meeting I’ve moved the benchmarks out of ‘Canvas3D API’ and into a newly created folder ‘Canvas3D API – Dev’. I left the unit testing framework in the old place for Mark to deal with. As I was typing the subversion commands I realised what a pain this name will be with web developers who have to deal with case-sensitivity and weird whitespace rules. We should probably rename the directory to c3dapi, to make it easier for everyone. Also I’ve noticed our performance go up quite a bit more (~45%). Now the 100 spinning cubes can do 26 FPS. That’s up from 16 when I ran the benchmarks last. Did anyone else run the benchmarks before commiting their stuff? If you did, perhaps you can claim responsibility fo the improvement. As decided in the meeting, it’s not going to be used by default. To enable it change the 0 to 1 in createScene(). I couldn’t think of any atomagic way to detect whether you want it or not, at least not without some good face recognition software (I’m the only one who’ll use it in the forseable future). It mostly works. I still need to:
  • add lights, this shouldn’t be too bad since there’s a chapter in the orange book about faking it with shaders,
  • figure out how to deal with the camera, I’m guessing something to do with the model-view matrix but this is not my expertise,
  • and finally figure out why the objects get distorted when they spin, this is usually one variable in one matrix somewhere that’s really hard to track down
I also ran into a really annoying javascript feature, or a bug of ours, depending on who you ask. We’re not using this.varname in the Scene ‘class’, and that makes the scope of member variables utterly obfuscated. Part of the reason (I guess, maybe all of the reason) we’re not using this.varname is that the render() is called via setInterval(), so when it’s called like that it isn’t really a member of the Scene class, or something. I won’t go on any more of a rant. But if I run into this problem again (oh just wait until multiple canvases per page come), someone will have to put some serious effort into fixing this (I’ll volunteer). The topic of kilobytes came up briefly on our last meeting, and just out of curiosity I thought I’d see how large the library actually is.Turns out all of the .js files (including the Main) in there take up a combined total of 116K. That’s including the 1.1 and 2.0 rendering code, and my debugging junk. I’m used to one paragraph of text taking up more than 1K, so this was quite a pleasant surprise. Of course I may yet find that it’s just that this mac isn’t capable of counting sizes properly, but I don’t care to double-check. I have turned my focus to fixing the 3d graph.  The problem I encountered had to do with the scene not resizing.  My work around for that is to re-create the scene instead and it works beautifully.  When I re-create the scene I have to re-add all the objects but I do that anyways.  On each update I have to remove and re-add all the objects in the scene which is not that different from re-creating the scene. Unfortunately the graph is not working.  At first my scene was not showing any objects but I have fixed that.  Now the math I used to create the size and position of each bar is not working.   I am going to recommend that some functions be added to the scene object that will return the distance from the edge of the canvas to the middle (0,0,0).  It will look at the canvas height and scene camera to determine positions.  I assume this can be done but I don’t know the math or what else needs to be taken into account. Andor has informed me that the obsolete code has been replaced so I will try and complete the Typing Game to have moving objects. I have just completed the first tutorial for our library.  It is simply a tutorial for installing the canvas 3d add-on.  I would be interested in knowing if the instructions for doing this are: a) clear (if unclear what parts?) b) complete (did I miss some crucial element?) If you are interested in getting started with using our library or just getting the add-on installed for your own use, feel free to follow the tutorial and let me know if there is anything that could be improved. I am also curious as to how many people were successful in getting the add-on installed in its current form and the hardware/software platforms they are using.  Any feedback on this would be greatly appreciated.

Videos

Demos

  • Asteroids-3D
  • Particle Systems Demo
  • Cross-Browser Orbiter
  • Mocap Demo With Spheres
  • Google Maps-3D

C3DL Development News

C3DL 2.0-WebGL and beyond

It has been a long time coming but we have now updated all the core features of C3DL to use WebGL. You can dowload our 2.0 release here. We have also updated all our demos to use WebGL. Our tutorials have all been updated (tutorial 5 and 6 needs a better example [...]

Preliminary WebGL RTS Game

Cathy asked me to make a cool demo using our library. After thinking about, I started getting many ideas, but creating a preliminary real-time strategy game made the most sense. It not only demonstrates a lot of C3DL features such as model loading, transformations, lighting, shaders, picking, cameras, textures, etc, but since animation is kept [...]

Tutorials

  • Tutorial #1: WebGL Browsers
  • Tutorial #2: A simple scene
  • Tutorial #3: Callback
  • Tutorial #4: Models
  • Tutorial #5: Light effects
  • Tutorial #6: Picking

Documentation

Archives

Archives

C3DL Development News

Recent Comments

  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • C3DL 2.0-WebGL and beyond
  • Preliminary WebGL RTS Game
  • Asteroids in 3D… and a bit of 2D
  • Another demo updated
  • Simplifying the Interface
  • Updating Demos
  • Cross-browser progress update
  • let there be vars
  • Creating tester pages
  • Problems with porting
  • keep it coming ve... - gero3
  • congrats on a great... - Paul Brunt
  • c++ not c# actually... - Cathy Leung
  • It's unbelievable ho... - Paul
  • Wow, now that's a co... - Andor Salga
  • Hi, is the project... - Sascha Hendel
  • I agree with both co... - Cathy Leung
  • Your library is real... - Sascha Hendel
  • Hi, as a more gener... - Sascha Hendel
  • Thanks. I just pull... - peter



Canvas 3d JS Library

©2007- 2009 Canvas 3d JS Library

Disclaimer: This website is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Canada License.
The Canvas 3d JS Library and Demos found on this website are licenced under the MIT License

Creative Commons License