5

To cut the long story short:

Is it possible to load a .vrml into Silverlight and render the 3d scene?

Now some more background information why I want to do this. I'd like to implement the following setup:

  1. Do some long-running calculations on the server
  2. Render some 3d-scene with mayavi
  3. export it as a .vrml file.
  4. Transfer it to a Silverlight-Client
  5. Render the 3d-scene within Silverlight
  6. Let the user interact with this scene, i.e., zoom, pan, rotate, ...

I expected it to be easy as recent versions of Silverlight come with XNA, but my research, both on Google and SO didn't give me any useful hints. It would be great if anybody could point me into the right direction, any links to tutorials, libraries or code snippets would be greatly appreciated.

As alternative file formats I could also produce, according to the mayavi-documentation

  • rib (renderman)
  • oogl (geomview)
  • iv (OpenInventor)
  • obj (wavefront)
Thorsten Kranz
  • 12,492
  • 2
  • 39
  • 56
  • 1
    There's [Balder](http://balder.codeplex.com/) which can import the [ASE](http://www.solosnake.com/main/ase.htm) format. It's not VRML, but you may be able to write a converter. You might also consider writing your own reader for the [OBJ format](http://en.wikipedia.org/wiki/Wavefront_.obj_file) and build the mesh programmatically as it's pretty simple to read. – Chris Sinclair Mar 13 '13 at 15:00
  • 1
    Can't believe I forgot this: the [Babylon Toolkit](http://babylontoolkit.codeplex.com/) which was designed specifically for Silverlight 5 to demonstrate its 3D capabilities, has [built-in Wavefront OBJ import](http://babylontoolkit.codeplex.com/documentation). – Chris Sinclair Mar 15 '13 at 21:08
  • This really looks good. I'll try it immediately. You could also make it an answer, so I could mark it as solution if my tries are successful. – Thorsten Kranz Mar 18 '13 at 08:25

2 Answers2

2

This looks promising:

http://www.postvision.net/SilverMotion/Default.aspx

Straight from the web-site:

Simply put the SilverMotion component into the Silverlight development enviornment and import your .3DS file, exported directly from a 3D modelling environment (Blender, 3DS Max, Maya, MilkShape and etc.) into it. That's it. The scene will be rendered, ready to be interacted within your browser.

You may have to do an intermediate file conversion, but as for the display component, it sounds like a snap to use.

jross
  • 1,129
  • 9
  • 10
  • Thanks for your hint, but it doesn't seem like 3ds-format can easily be written with Mayavi, though I need to do more research regarding this question. – Thorsten Kranz Mar 12 '13 at 19:37
  • Yeah, come to think of it, I probably should have left the suggestion in a comment like Chris Sinclair did above. In fact his suggestion is possibly even more promising than mine, being that it is open source. – jross Mar 15 '13 at 05:04
  • Conversion seems to be a hard job, I'll first try the Babylon Toolkit, and see if it helps me. – Thorsten Kranz Mar 18 '13 at 08:26
1

You could give the Babylon Toolkit a shot (which was designed specifically for Silverlight 5 to demonstrate its 3D capabilities) as it has built-in Wavefront OBJ import. I can't comment specifically as to how well it imports as I haven't used it specifically.

Chris Sinclair
  • 22,858
  • 3
  • 52
  • 93