Browsing articles in "Javascript"
Jan 30, 2012
Klas

Md2 to json converter

Tried to make a simple little “webapp” that converts Md2 models(the old quake 2 model format) into the json format(version 3) that is used by three.js.

You simply open the page, and then drag and drop a *.md2 file and it will be converted and a preview of the mesh should appear. You can then drag and drop jpg/png images for the texture to be previewed as well.
Move the mouse left/right to spin the model, up/down to move the y position. Scrollwheel to scale it.
If it looks ok, enter a filename and hit “Save”.
It should now be downloaded(in Chrome at least, Firefox opens it in a new window).

You can then load in the json files into your three.js projects and use them as morphTargets.

MD2 to JSON Converter (a model to test with, if you don’t have one)

Example of converted model as morphTarget

Stresstest

Three.js

I have only tested this in Chrome and Firefox, so not sure if it works anywhere else. Mostly done as an exercise for myself to understand the format, drag and drop and filehandling etc. But might be useful to someone else out there.

Edit (Mar 08, 2012): Looks like I had the exporter output a horizontally flipped model, should be fixed now. Thanks to @alteredq for letting me know.

Dec 29, 2010
Klas

Bye 2010

Another busy year have (almost) passed, and more projects behind me. We have one site nominated at The Fwa:s Peoples Choice Awards 2010 this time, it’s July.
Things slowed down a bit towards the end of the year though. Great for me, had time to play with some mobile/android stuff. And later also try a bit of js+canvas and some WebGL. I can really see the potential. Really fun to play with from a developers point-of-view.
I also actually ended up using twitter, it’s a good work-tool/channel to see trends and what people are up to etc. You can ‘follow’ me @oosmoxiecode.
This site is nearing 10 years without a remake/update… lol. I would really like to convert it to a wordpress-solution.. some day.

Have a great 2011 everyone!

Twitter

Categories