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
    • Tutorial #7: Materials
    • Tutorial #8: Particle Systems
    • Tutorial #9: Camera Basics
    • Tutorial #10: Advanced FreeCamera
    • Tutorial #11: OrbitCamera
    • Tutorial #12: Advanced Camera Functions
  • 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
  • RTS Prototype
  • Particle Systems Demo
  • Cross-Browser Orbiter
  • Mocap Demo With Spheres
  • Google Maps-3D

C3DL Development News

A spec change that keeps coming back to haunt me

At some point, the way firefox handles keyboard events changed. I’m not sure exactly when it happened, all I know is that it broke how I was dealing with keyboard interaction on almost every demo I’ve written (for example,the mocap demo and MotionView). When I wrote the demos, the keydown event would be fired once, [...]

Release 2.2

The 2.2 Release of the Canvas 3D Library includes a number of new features, updates to old features and fixes for several bugs along with the requisite changes to meet the evolving WebGL spec. Some of the things included (in no particular order) are: Better picking code. The ability to swap textures as a scene [...]

Tutorials

  • Tutorial #1: WebGL Browsers
  • Tutorial #2: A simple scene
  • Tutorial #3: Callback
  • Tutorial #4: Models
  • Tutorial #5: Light effects
  • Tutorial #6: Picking
  • Tutorial #7: Materials
  • Tutorial #8: Particle Systems
  • Tutorial #9: Camera Basics
    • Tutorial9-YawPitchRoll
  • Tutorial #10: Advanced FreeCamera
  • Tutorial #11: OrbitCamera
  • Tutorial #12: Advanced Camera Functions

Documentation

Archives

Archives

C3DL Development News

Recent Comments

  • June 2011
  • March 2011
  • October 2010
  • July 2010
  • April 2010
  • March 2010
  • 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
  • A spec change that keeps coming back to haunt me
  • Release 2.2
  • 2.1 Release and things to come
  • Level Up! An Open Web Game Jam
  • Site moved!
  • SceneCreator0.3
  • WWW2010 in Raleigh
  • Motionview
  • On the train to Mountainview
  • C3DL 2.0-WebGL and beyond
  • That depends on what... - peter
  • This application is ... - Haisens
  • I think that example... - peter
  • The above links are ... - Atash
  • Hi there, just wante... - Patrick H. Lauke
  • Firefox 4 was releas... - Cathy Leung
  • In order to access l... - peter
  • I am not able to dis... - preksha
  • "JavaScript can’t di... - Joe Hocking
  • I should point out t... - peter



Canvas 3d JS Library

©2007- 2010 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