Usually WebGL libraries like three.js provide conversion tools that convert the input 3ds model to either obj and then into JSON format. Here I present my solution to load the binary 3ds model file directly in WebGL. Here is a live demo of my library.
Try the full screen version: https://dl.dropbox.com/u/5513476/3dsViewer/3dsViewer.html
Controls are:
Left click and drag to rotate
Middle click and drag to zoom in/out
Of course comments and critics welcome. I want to know what the feedback is before and go ahead and implement it as a full fledge 3DS loader.
Currently, the model is diffusely shaded with gray material. I am currently working to load the materials as well as textures. I am planning to make it a full fledge 3D modelviewer and will work on it as soon as I find some more time. Here are some snapshots from the viewer.
Try the full screen version: https://dl.dropbox.com/u/5513476/3dsViewer/3dsViewer.html
Controls are:
Left click and drag to rotate
Middle click and drag to zoom in/out
Of course comments and critics welcome. I want to know what the feedback is before and go ahead and implement it as a full fledge 3DS loader.
Currently, the model is diffusely shaded with gray material. I am currently working to load the materials as well as textures. I am planning to make it a full fledge 3D modelviewer and will work on it as soon as I find some more time. Here are some snapshots from the viewer.
15 comments:
Hello my friend! Nice work and promising alot!
So here is the deal, I have big models with materials and everything, that are produced from a software we have created for concrete buildings...
You can see it here: here I am This our work. So, we want to make this digital book 3D capable for the average user, that of course he should pay a little something to see the 3Dversion.
Do you think your very nice work could be helpful? Do you have something in mind? You look like a very "into the thing guy" so I feel lucky finding you after googling for almost a week to find such a clever solution!
Costis K.
Hi Friend,
Thanks for the nice comments. Actually, your work looks very promising indeed. Can your application output conventional object formats like .obj, .3ds etc. If that is the case, you can directly the code that I have shared above. Otherwise, you will have to manually create a loader in WebGL which should not be that difficult.
Let me know how it goes. In case you want me to help you out, you can give me a private email on my gmail account (mmmovania at gmail dot com).
Thanks,
Mobeen
Hi, can you please update the code, such that files are loaded from the server itself. i.e not allowing user to select the file.
Hi Karthik,
I wanted to give the flexibility for the user to load their own 3ds model files. Rest assured I don't copy your meshes anywhere. Are you concerned about this?
This is great..
Email storage
Great tool, please keep up the good work and support also the materials (and textures).
But the keyframes are not important.
BTW: I'm an avid fan of your OpenGL-book at Packt ;-)
Good work,
kr,
Peter
Hey Peter,
Thanks for the support and appreciation. I am glad you like my OpenGL Development Cookbook.
I will certainly extend the 3DS loader for WebGL perhaps give it out as a model format for three.js but that needs some time. I definitely have this in mind.
Regards,
Mobeen
Very nice the possibility to load 3ds files with textures directly... I'm searching for that, finding you just now! Lucky me :-)
Hi Ricardo,
Great to know it is useful for you. Currently, I have not implemented loading of textures but that is a piece of cake. I will do it if there are more request or possibly release this as an opensource lib.
Thanks,
Mobeen
Hi,
are there any updates on textures or colors on 3ds objects?
is there some documentation on how to do this?
Hi,
I have done texture loading and colors but have not linked it to the blog yet. The version shown here is a simple mesh loader without colors/textures. I did not find time to extend it further.
Thanks.
Mobeen
I will work on this if there is interest from many users.
there is interest from many users =(
Hi Airaleais,
I have completed the 3DS loader with texture mapping as well as all 3dsmax material browser tiling settings as well as all hierarchical including informaition of animation tracks. I will upload a public version soon when I will be free.
Thanks for your interest in this.
Regards,
Mobeen
Post a Comment