Canvas 3d JS Library

where 3D is born!
  • rss
  • What is C3DL?
  • Download
  • Tutorials
    • Tutorial #1: Installing Canvas 3D Addon
    • Tutorial #2: A Scene and a Cube
    • Tutorial #3: Update Callback
    • Tutorial #4: Models 101
  • Development News
  • Demos
    • Typing Game V2.1
    • Typing Game V3 (0.3 Release)
    • Explorer
    • Flickr - Picking
    • Ricochet
    • FSOSS Pictures
    • Puzzler
  • Resources
  • Contact
  • About

Weather Graph

Chris Bishop | 9 July, 2008 | 12:15
In resurrecting the 3d Graph I decided to remove the user from adding input and pulling input from an external source.  I decided to do a weather graph.  I found an XML source I can use from http://www.yr.no/place/Canada/Ontario/Toronto/forecast.xml .  I haven’t worked with XML yet so I’m very interested in learning to parse through an XML file and turn it into 3d objects. What I’ll actually be doing is grabbing most of the raw data and displaying it on the screen no differently then you see at any weather site.  I’ll use the temperatures to create the 3d graph, which happens to look more like a 2d graph. Looking into the much distance future I see a world where users visit a site and see a 3d globe showing the weather patterns for around the world.  The user would then grab an area of the globe and drag it closer to see more weather patterns for an area, zooming closer and closer until viewing one area with the weather for the day.  A truly 3d weather report.
Categories
c3dl development
Comments rss
Comments rss

« Unit tests (almost) done 0.3 Release - models and textures! »

8 responses

Hi ! I'm implementing an OpenGL viewer with the C3DAPI

HADDAD Kamel | 28 July, 2008 | 10:30

Hi ! I’m implementing an OpenGL viewer with the C3DAPI

and I can’t display an object with multiple textures.

I’m using a vertex and a fragment shader.

I can render my 3d model with one layer of texture ( used as diffuse color ).

I want to add a second texture for bump mapping.

I use the “glweb20″ mode and only the first floor texture appear.

The following code works fine :

gl.activeTexture(gl.TEXTURE0); // for the first floor then

gl.bindTexture(gl.TEXTURE_2D,texture_id);

while the following code does not work :

gl.activeTexture(gl.TEXTURE1);

gl.bindTexture(gl.TEXTURE_2D,texture_id);

no texture appear.

Does anybody know if multi texturing is currently supported in the canvas3d?

Is there a working example somewhere that could be helpfull?

Thanks.

Currently we have single texture support but only in the

Cathy Leung | 30 July, 2008 | 14:32

Currently we have single texture support but only in the glweb1 context and not the glweb20 context. Multi-texturing is something that we will probably look at adding in the future but we don’t have it right now.

The demo on the front page uses the library on a model with only 1 texture. The object spinning is faked atm (camera is reolving around a still object) but in the next release this won’t be the case.

I am working on a max-script to exporting the model data out of 3d studio max.

Hi Mrs Leung ! Thanks for your answer. But i don't

Haddad Kamel | 31 July, 2008 | 4:04

Hi Mrs Leung !

Thanks for your answer. But i don’t understand why you say that the C3DAPI supports only one texture in the glweb1 context because i’m using the glweb20 context and it works fine ? Does it mean it’s impossible to do multitexturing or it’s impossible to bind more than one texture ?

In my code, the 3D model has one texture but it’s possible to make some textures and to bind them but for the moment, only the last bound can be used.
For multi-texturing, I think i’ll wait the next versions to continue my viewer. If i can, in the future, take part in your work for a little part it will be with pleasure…

Congratulations for your works…

Hello Haddad, You are correct. Currently we are supporting only

Cathy Leung | 31 July, 2008 | 22:58

Hello Haddad,

You are correct. Currently we are supporting only one texture in the library’s model structure to get a good baseline performance wise. Changing the texture is allowed though (and that is why you are seeing only the last texture show on the model. The glweb1 and glweb2 context support multiple textures but our library currently does not have this yet. It is something that we will probably add in the future.

If you are interested in joining us on our project please feel free to do so. Its what open source is all about! :D. We are on IRC most weekdays from 9am to 5pm est. Network: moznet, channel: c3dl. Come have a chat with us :)

ps… not to be a drag, but Mrs Leung is my mother ;)

Hi ! Thanks for your explications but i don't understand

Haddad Kamel | 1 August, 2008 | 3:14

Hi !

Thanks for your explications but i don’t understand again when you say that your library supports only one texture. Can you bind or see only one texture ? To join you, i’ll think about it because i’ve some work for the moment but your project is very interesting so i think that it will be possible as soon as i have more free time and i’ll come have a chat with you too.

PS: I’m sorry for the inconvenience about “Mrs Leung” but in my country “cathy” is a womanish
name :D…I hope that you’re not angry for it :D ( my name is Kamel and not Haddad ). ;-)

Currently an object can only have one texture, but you

Andor | 1 August, 2008 | 8:43

Currently an object can only have one texture, but you can have multiple objects in a scene each with their own single texture. Hope that helps.

Kamel, I think perhaps there may be a misunderstanding so I'll

Cathy Leung | 1 August, 2008 | 14:14

Kamel,

I think perhaps there may be a misunderstanding so I’ll try to clarify a bit on our project and why there is only one texture per object atm.

Firstly the canvas 3d addon which you can get from addons.mozilla.org allows you to create an open gl context to support 3D within the canvas. To do 3D using the addon directly would require knowledge about 3D and 3D programming that many people would not have. The canvas 3D addon supports multiple textures because its two contexts mirror the features of opengles 1.1 and opengles 2.0

Our library is built on top of the canvas 3d addon. It is meant to make it easy for people who do not know too much about 3D or open gl programming to produce 3D in the browser. Therefore our library has a more limited scope than what the canvas 3D addon allows but provides functionality to take the sting out of 3D programming. This is why our library currently does not have multi texturing support. We are simply starting out with a basic feature set that people would find useful and expanding from there.

ps. about my last comment… I am actually a girl, I just meant I’m more of a “ms” than a “mrs” :)

Hi Cathy, I'm sorry for the last inconvenience now i understand

Kamel Haddad | 3 August, 2008 | 9:47

Hi Cathy,

I’m sorry for the last inconvenience now i understand :D. ( Are you an M.I.T girl student ? ) For the C3DL i’ll wait and in understand why you want to wait to create a more easy programming librabry for all users. If my english is so bad pleaso to excuse me i’m a french programmer so i try to speak correctly but it don’t ever works. When you’ll have add some features to your library can you send me an email ? I think that you should have it ? Thanks for your fast answers…As soon as i can work with you it will be with pleasure and i’ll contact you on IRC.

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>

Search

Demos

  • Explorer
  • Flickr - Picking
  • FSOSS Pictures
  • Puzzler
  • Ricochet
  • Typing Game V2.1
  • Typing Game V3 (0.3 Release)

C3DL Development News

Namespaces and const

As our library expands with more functions, classes and global variables, the need for namespacing increases.  I started placing code in a C3DL namespace when I wrote the matrix stack operations.  However, yesterday I was looking in the constants.js file and saw the ‘tolerance’ variable.  It’s a const variable used when comparing floats to check [...]

DAE Scenegraph

We have code which parses collada/DAE files, but to a limited degree. The parser only extracts the geometry data. Therefore if a file is ‘simple’, it loads correctly since the scene graph has only one transform node. However if the collada file contains many transform nodes, each node with different geometry will be [...]

Tutorials

  • Tutorial #1: Installing Canvas 3D Addon
  • Tutorial #2: A Scene and a Cube
  • Tutorial #3: Update Callback
  • Tutorial #4: Models 101

Archives

C3DL Development News

Recent Comments

  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • Namespaces and const
  • DAE Scenegraph
  • The Matrix Stack
  • .obj to .dae
  • 0.5 Release and Other News!
  • Tracemonkey performance
  • More memory usage improvements
  • Canvas3D crashes in tracemonkey
  • Patched one hole in floating text
  • Drawering on a texture 2D canvas
  • For name spaces, my... - Jeremy Giberson
  • Great! Really really... - Edson Mattos
  • Beautiful!... - Funtomas
  • Was no need to conta... - Andrew Smith
  • Andrew, have you con... - Funtomas
  • Thanks for posting t... - Andrew Smith
  • Vlad was in town and... - Cathy Leung
  • the upside down issu... - Cathy Leung
  • Got it! the addon is... - Bill Mill
  • Yes it does. The ad... - Cathy Leung



Canvas 3d JS Library

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