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

Flickr Demo – Almost done!

Chris Bishop | 30 July, 2008 | 12:19
I have completed the flickr demo and need to polish it up for displaying on the website.  The demo has 5 untextured cubes.  The user enters a search term and then clicks a button to search flickr for 5 images.  Once the images have been found they are downloaded and applied to the 5 cubes.  The user has the option to search for the next 5 pictures available if so desired.  The cube can be rotated in any given direction by clicking and dragging the cube.  Zooming and out from a cube happens by double clicking the cube. I said I would have the demo done this week but I ran into problems with the Free Camera.  I believe at one time the Free Camera Object would rotate around its Look At Point when its position was changed.  With this assumption I was setting its Look At Point to a point in 3d space.  This resulted in weird behaviour.  It turns out the Free Camera has changed and the Look At Point is not a fixed point in space but more of a direction and the camera does not rotate around the Look At Point when its position has changed. Here is my attempt to illustrate the situation: You are standing in a room looking at a chair in the middle of that room and you are facing the chair directly. What I thought would happen: Taking 2 steps to your left would result in doing a side step to the left and turning your body to the right to remain facing the chair directly. What is happening: Taking 2 steps to your left will result in doing a side step without turning your body to the right.  You are no longer looking directly at the chair. So it turned out I didn’t need to set the Look At Point since the Camera did not rotate on its own.  Another issue I came across was with Intervals in Javascript.  We have an Interval that runs to update the scene and all the objects in the scene.  Well I has set the linear velocity of the camera so it would move to the right spot gradually and I needed a way to check if the camera had arrived.  I used a timer to check every 250 milliseconds if the camera was close.  I started some debugging to see how close the camera was getting and I notice that my interval was only being executed about 3 times.  So I decreased my interval to 25 milliseconds and my interval was now executed 4 times.  I created a counter and removed as much processing as possible from the function and still it was only called 4 times.  I have not looked into it but there may be issues with intervals in Javascript.  I’m not sure how we’ll be handling threading in the future.  The problem might not have been the intervals since I have not researched it but I plan to.
Categories
c3dl development
Comments rss
Comments rss

« Explorer demo (not the browser) 0.4 Release »

2 responses

Awesome, can't wait!

David Humphrey | 30 July, 2008 | 22:59

Awesome, can’t wait!

the problem you see is recent ...I don't think the

Cathy Leung | 31 July, 2008 | 12:51

the problem you see is recent …I don’t think the 0.3 release has this problem as I used a moving camera trick to simulate the spinning teapot (see front page source on this). I think that andor is working on fixing this.

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

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