3D dress-up game?

My daughter (8 yo) has been asking if there’s an iPad game that, it seems to me, ought to actually exist.

There are plllllllllllenty of dress-up-doll games on the App Store, but they all are mix-n-match experiences. Some have a ton of things to mix and match from, but everything that you can do is to some extent pre-rolled.

What my daughter wants is to be able to literally design the clothes–dictate the length of the sleeves, the size of the shoulders, choose all the colors, etc–and see them on a 3D model.

There are some things very close, but nothing like this actually exists. I know it would be a huge project for Codea, but would it be, theoretically, a stretch for the engine’s current capabilities?

You’d need:

  • some form of human model, both male and female (doesn’t have to be ultra detailed)
  • some basic template for clothes that hug limbs – i.e. pants and shirts
  • some basic template for clothes that hang–dresses, basically
  • an ability to edit the visible/invisible parts of the clothes templates–so you could make a sleeve shorter, for instance, or a neckline wider
  • a visual editor that basically was the flattened 3D mesh of the basic templates–draw directly on the mesh and you see it on the model right away
  • possibly hair and face stuff (a whole pickle on its own right there, but let’s stick with just clothes for the moment)

…of course, each of those bullet points is a heck of a project all on its own!

…but other than the huge expenditure of time required, it seems to me there’s no reason Codea couldn’t do that. Is there any reason Codea couldn’t do that?

It would be possible, but extremely difficult

Well, sure it’s hard!

But let’s break it down:

  • Making a simple human form is the first huge hurdle, but the challenge is mainly plotting the vertices. Once you’ve got that figured out, rendering it and rotating it and etc is not problem for Codea. And if you do it nice and modularly:
  • you can use the torso mesh for shirts
  • you can use the pelvis mesh for pants
  • Creating a UI for drawing an image to be used by the mesh is the next big hurdle, though lots of people on these forums have posted some basic drawing projects that could be used to build on.
  • Applying the image to the mesh once you’ve drawn it is just basic Codea stuff.

There would of course be an issue with how the image distorts around the mesh vertices, but for a first pass it would be a good start.

That wouldn’t achieve everything I described at first, but it seems like it would establish the core functionality.

MakeHuman can create humanoid meshes and has a few types of clothes. I think it can export .obj format, and then you can use @Ignatz 's .obj importer to import them. By far the hardest part of the spec would be modifying these meshes within Codea (eg adding and deforming verts).

I think the easiest way to do this would be to set up a bunch of shape deform keys in Blender (eg for short short sleeves/ long sleeves etc). Then export models for the full extent of each deformation, and then use my key frame interpolation code to leap lerp between these key frames, so that you can animate a sleeve lengthening and shortening in response to user’s touch.

See this series of posts for how to interpolate between key frames: https://puffinturtle.wordpress.com/2015/05/14/animating-a-3d-blender-model-in-codea-part-1/comment-page-1/#comment-1

@UberGoober - Having raised three girls who spent a lot of time dressing real and virtual dolls, I think I know exactly what you are looking for - a version of the Sims dressing room, where you can modify the actual clothing design.

If you simply want to give your daughter something that works, before she outgrows this phase, I suggest getting one of The Sims mods, like this.

That’s because what you’re asking is horrendously difficult. Getting clothing to hang properly, the look of different materials, and making face and hair (with different options, please, dad), is something I can’t do after nearly three years with Codea, and then if you want to animate the model… To see just how hard it is, you just have to look at the Sims, and you’ll see it is quite wooden and not very realistic, and that was done with a big budget, with skills evolved over many years and different versions, by highly skilled professionals!

So the reason most of my 3D projects (and many commercial games) involve vehicles is that they have a fixed shape,which don’t have to be animated (or have clothes hung on them!).

If you still want to do it as a challenge, I would recommend finding a different one. It’s really that hard, unless you have amazing graphic skills, and it would take so long, and still be so lame compared with programs like the Sims, that I doubt it would end up achieving what you want.

If you are really keen, I would treat it as a series of projects and start on them one by one. It will probably morph into something completely different over time, but that’s the fun of programming…

@Ignatz - you’re right on target, and who knows how far this will get. Getting a good idea of the challenge seems like the first order of business.

I’m thinking what’s needed is to pare the objectives way, way down. To wit:

  1. get a female 3D model from MakeHuman into a dress–oddly enough this seems like one of the hardest steps right there!–and make the dress have a separate long-sleeved top and floor-length bottom
  2. get that model into Codea via the .obj importer–theoretically simple enough
  3. make the meshes for dress and for the top each use a local image resource for texture–it looks like yojimbo’s .ply importer can do some of this, so I guess that’s where I’d look first
  4. get the top mesh to treat the alpha color as the model’s flesh color, and the dress mesh to treat alpha normally (as transparent)–Codea’s built-in image manipulation methods should be able to handle that
  5. as for editing the texture file, the simplest thing would be to skip the whole “image editing UI” thing and just have the file on Dropbox, and edit it with an external image editor.

…while still challenging, that seems well short of “horrendously difficult,” at least on paper.

Try making the dress drape realistically over a curved figure, then you’ll know the meaning of horrendous.

But don’t let me put you off. I’ll be delighted if you prove me wrong.

I guess I was assuming MakeClothes and MakeHuman would produce a reasonable facsimile of a draping dress. Not talking about it moving or anything. But those programs seem like that’s their whole thing.

Your problem is that you want to be able to change the design of the dress. Colour would be easy. But once you start moving vertices, you have to think about how it changes the way it hangs.

Right, that’s definitely true, and in that five-step plan I made up there I’m thinking way less ambitious than moving vertices at all.

To get the thing started, I meant to describe simply a dress and top whose length could be easily modified in a drawing program–just by messing with transparency. So the floor-length dress could be erased into a miniskirt–the rest would still be there, but it would be invisible because of alpha channeling.

This would also allow you to mess with not just sleeve length but the cut of the collar, or you could even make a strapless dress top, all relatively cheaply and needing no vertex fooling around at all.

Of course it would be janky in all sorts of ways, but I’m just saying, seems like a reasonably achievable way to start.

OK, good luck. You may find shaders useful for this project.

Ok, that sounds a lot more manageable. Essentially you’d be writing a 2D drawing program, just one that projects its image onto a 3D model. You might want to look around for some starting points that offer simpler, and less photorealistic, models than makehuman. There are certainly no shortage of simple humanoid models out there. I find blendswap a good site to go to for inspiration, and lots of the models there are licensed so that it’s easy to use them in your own projects (eg CC By, where you just have to attribute the author).

Do these other human models have built-in modular clothing that can be swapped on and off the model? I’m not crazy about the MakeHuman look, but it pre-rolls a system for swapping clothes in and out. If there’s something of a comparable facility, I haven’t been able to find it. I’d love it though!

I don’t know, you’d have to search. Finding usable models can be tricky. People do quite often create characters with a variety of “skins”.

I think the success of this project is going to depend to an extent on how comfortable you are with 3D modelling software such as Blender. I’ve seen quite simple tutorials about creating clothing for a model using Blender’s shrinkwrap modifier. You basically put a simple shape, even just a cube, the rough dimensions of the clothing you’re creating, over the humanoid figure and hit shrinkwrap. If you’re not after hyper-realism, that could be enough. There’s also a cloth simulator. I’ve not used that though, and I don’t know if that’s something that would translate into a usable .obj export. Blender’s UI is a nightmare at first, but there are so, so many tutorials out there that it really doesn’t take long to get some basic sculpting skills (apologies if you are already past this stage). I would recommend to anyone to give it a bash. It’s a lot more satisfying than using an off-the-shelf model, and you can make something to precisely your own specifications.

I don’t have any Blender skills, but just in MakeHuman I’ve been able to get a full-sleeve sweater, jeans, and shoes on a female model, and export it to .obj format.

It’s not exactly what I was hoping for as step 1, according to the 5 steps above, but let’s be a little agile about this, right? I’d say it’s good enough for the moment to proceed to step 2.

I must say, it’s odd that MakeHuman is built in Python and yet doesn’t export to .ply format…

Is this the link to the code to use to import the .obj file to Codea?

https://gist.github.com/dermotbalson/7871147

yes. Have you found the instructions on coolcodea?