October 2014

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  










« Finding a point on an AutoCAD surface based on X,Y coordinates using .NET – Part 2 | Main | 2D vs. 3D graphics system inside AutoCAD (+ request for information) »

March 11, 2013

Using augmented reality to preview the output of 123D Creature

A few weeks ago, we looked at using PointCloud Browser to visualize simple spherical primitives brought down from a web-service, as well as creating a simple AR game to obliterate them.

Visualizing (and popping) spheres is all well and good, but clearly it’d ultimately be much more interesting to visualize more complex objects in an AR scene. The good news is that PointCloud Browser supports loading models from .OBJ files, a format generated by a number of Autodesk products – particularly those used in the Media & Entertainment space. I’m not a big user of 3ds Max or Maya, and so decided to take a shot at using one of our newer, consumer-oriented iOS apps called 123D Creature.

123D Creature

123D Creature is cool (and great value at $2). It provides character modeling and sculpting capabilities to your iPad, and is even useable by 3D modeling luddites such as myself.

You start by using some straightforward tools to manipulate a default skeleton…

Basic skeleton

… into something with the basic characteristics you’re looking for. At which point you “bake” the skeleton and can start working on it with clay-sculpting and painting tools.

As a first attempt I managed to create this:

Slightly sculptedA bit more so

Now with paint

 

 

 

 

 

 

Nothing earth-shattering, but I was pretty amazed to have even made something this tolerable on a first pass given my experience and level of artistic talent.

Getting an .OBJ file from a 123D Creature model is very simple: from the Projects menu, you simply select “Export Mesh”, at which point you can choose either to email it to yourself or to send it to iTunes. These meshes are generally pretty big – once you’ve baked the skeleton they generally run to around 25MB at a minimum – so I’ve tended to use iTunes to get at them.

“Sending to iTunes” means a ZIP will show up in the documents associated with the 123D Creature app – from there you can save it locally and extract its contents. The ZIP file contains the .OBJ file as well as any textures that you’ve either painted or applied.

To load an .OBJ file into a PointCloud Browser scene, I used the following very simple HTML page:

<!DOCTYPE html>

<html>

  <head>

    <title>123D Creature Preview</title>

    <meta

      name="viewport"

      content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

    <meta name="viper-init-options" content="manual"/>

    <link

      rel="viper-app-icon" type="images/png"

      href="resources/images/appicon.jpg"/>

    <script type="text/xml" id="scene">

      <scene base="relative-baseplane">

        <light id="main_light"

          intensity="1.0"

          fade="constant"

          ambient="0.2, 0.2, 0.2, 0.2"

          diffuse="1.0, 1.0, 1.0, 1.0"

          specular="1.0, 1.2, 1.2, 1.0"

          position="3, 0.5, 2, 0"/>

        <node

          id="creature_node"

          position="0,0,0"

          rotation="0,0,270"

          scale="0.15"

          static="true">

          <model src="SkeletonShape.obj" id="creature_model" />

        </node>

      </scene>

    </script>

    <script type="text/javascript">

      function onAppLoaded() {

        viper.requireRealityMap();

      }

    </script>

  </head>

  <body/>

</html>

The big issue I faced was with the size – in bytes – of the mesh. As mentioned earlier, the size of any baked model – and there are some fantastic examples being created and shared by the user community – starts at around 25MB, which leads to a few problems: firstly, it’s a 25MB resource that needs to be downloaded when loading the scene and, secondly, this also means more resources are required at runtime to display the mesh.

On my iPad 2 it turned out to be prohibitive: I wasn’t able to see any baked meshes inside my AR scene. The level of detail maintained is clearly intended for processes such as 3D printing rather than reality augmentation on mobile devices, so you can certainly understand why these meshes feel a little heavy for our purposes.

The good news is that skeleton meshes – prior to the baking process – are much smaller (typically weighing in between 500KB and 5MB). You don’t have the finer detail you get with a baked model, but then you can still build in a fair amount of interesting detail with just the skeleton-editing tools.

Here’s an example of a somewhat more elaborate skeleton inside 123D Creature…

More elaborate skeleton

And when we load it inside a PointCloud Browser scene with the above code we can see it displayed relatively well (albeit translucently and with no material – as that gets applied post-bake, of course).

Front view

Right(ish) view

Left view

When iOS devices have the capability to deal with more complex meshes – and it may well be that iPhone 5 and iPad 4 devices already do better than my aging iPad 2 – then this could be pretty interesting way to visualize more complex meshes. And that doesn’t just go for the output from 123D Creature, of course: you could also be generating your own .OBJ output from a number of Autodesk (and other) products.

Now that I’ve got a taste for this, next time I’m going to take a shot at using Project Pinocchio over on Autodesk Labs to generate a character and getting that displayed inside a PointCloud Browser scene.

blog comments powered by Disqus

Feed/Share

10 Random Posts