6
votes

I recently discovered WebGL and particularly Three.js, which is the best API I've found so far for that. For now I'm just coding simple demos to display 3D models of starships from my main project, which is a Sci-Fi universe.

My mid-term goal is to enhance a MediaWiki wiki with 3D display of objects described in pages, with orbit camera. I see it as a tool for presenting the contents of the universe we're developping.

I want nothing fancy or difficult to do per se, I know how to do that with standard Wavefront .OBJ and .MTL files, and it's quite enough for me. But it's the wiki integration that worries me.

The base idea would be to first upload the various files (models, materials, textures) as wiki files typed by their extension, then having the extension add a wikicode item or a template to use them at will from their wiki URLs.

If we stay with the .OBJ/.MTL example :
- .MTL would be displayed as materials applied on a sphere with some obejcts bouncing around to see mirror effects, with adjustable ambient/background for contrast,
- .OBJ would be displayed by blankly applying its materials, also with adjustable ambient/background.

Is there already such an extension or at least a framework that could be used and expanded into it, or is it up to me to develop, knowing I probably'll have neither the skill nor the time?

2
For what it's worth, there's JMOL, which shows 3d objects, but not using WebGL. mediawiki.org/wiki/Extension:JmolAmir E. Aharoni
Interesting, but too specialized for me, I wanna display starships ^-^Mutos

2 Answers

1
votes

You should take a look at Sketchfab. It's a web application where you can upload your models, it will display it to WebGL directly. In the link above you'll see their embed functions. There is no MediaWiki special code but there is also an API if you want.

NB : They works as 'Freemium', the first 500Mo are free after that you have to pay some dollars every month.

1
votes

If you just want to display models you might want to take a look at x3dom. I don't know what steps you'd need tointegrate it into mediawiki though.

On the other hand, on the Khronos WebGL Wiki we use some iframe plugin to let us put random WebGL samples on the wiki.