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
  • Development News
  • Documentation
  • Community
  • Resources
  • Contact
  • About

instanceof issues

Andor Salga | 18 October, 2009 | 11:58
When I first started work on porting the C3DL library from using Canvas 3D to WebGL, I ran into a problem with instanceof. In a particular line of code, I check if an object is an instance of a type. It always worked on Firefox 3.5 using Canvas 3D and everything renders properly. However, using Firefox 3.7a1pre, the conditional evaluated to false. I commented the line and I continued working eventually getting something drawn. I did this by adding ID’s to most of the C3DL classes as well as a getObjectType() function. This was simply a workaround so I could focus on more important tasks. This week I went back to the instanceof problem. I needed an isolated case to see if perhaps the library was at fault, so I wrote a short script in an HTML file. I found that on Firefox 3.5, it worked fine, but on Firefox 3.7a1pre, it didn’t. After mentioning this in #seneca on irc.mozilla.org, Chris Tyler suggested I file the bug. So I did. The next morning I continued to work on the bug. After talking with a number of people on IRC, I learned a few things. There is a JavaScript shell available when you check out the Firefox source. On my machine I found it at
mozilla-central/obj-ff-dbg/dist/bin/js
I started the shell and tried the folowing:
macbook-pro:bin andor$ ./js
js> var ns = {};
js> ns.test = function(){};
(function () {})
js> var iTest = new ns.test();
js> print(iTest instanceof ns.test);
false
Still false. I decided to update my repository and rebuild. Maybe the issue was already resolved and only existed for a few days? I went back to my console and updated.
hg pull
I then did a full build.
make -f client.mk build
The first thing I noticed is that the small icons in each tab are now cute little progress bars. progress bar Back to the issue, I ran the test again and it still fails. I’m pretty much stuck and this point in regards to the bug. I’ll either have to wait for someone else to confirm or I may try on another system. While I wait for that, I’ll be returning my attention back to porting to WebGL.
Categories
c3dl development
Comments rss
Comments rss
Trackback
Trackback

« Orbiter 1.1 3D Google maps demo »

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Videos

Demos

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

C3DL Development News

SceneCreator0.3

SceneCaster is an online application that allows people to create “spaces” which are 3d scenes on the browsers and share them which other.  It is free to sign up and relatively  easy easy to use. The main problems with SceneCaster are the requirements: The operating systems used are Windows XP or Vista and the browser [...]

WWW2010 in Raleigh

Yesterday Andor and I gave a talk at www 2010. It was about how mid level API’s can help web developers who may not wish to do extremely low level programming at the WebGL level achieve the 3D effects they want. The “slides” from our talk can be found here. The [...]

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

Documentation

Archives

Archives

C3DL Development News

Recent Comments

  • 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
  • SceneCreator0.3
  • WWW2010 in Raleigh
  • Motionview
  • On the train to Mountainview
  • 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
  • I'm encountering sim... - peter
  • I'm having the darnd... - Jeff
  • Excellent, I'm looki... - Some Funky Dude
  • Great demo! I was th... - Some Funky Dude
  • Hey, just wanted to... - Charles
  • 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



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