Modelling clothing in C++ [closed]

大憨熊 提交于 2020-01-12 06:24:09

问题


I'm looking to write a bit of software that will end up drawing a human frame (which can be configured with various parameters), and the plan is to have some sort of clothing placed on the dummy.

I've looked at Blender, and OpenGL libraries as well as other rendering and physics engines, I'm not looking for you to tell me how to do this, but mainly I'm wondering what libraries are out there to do this sort of thing?

So there'll be a pattern for the clothing in 2d, then the system, (at least in theory) will be able to translate that in to a 3d representation of a shirt for example? And then place that on the human frame. I know there's a lot of work I need to do for this, however in terms of rendering the clothing on to the frame, and accounting for collisions and how it drops around the frame etc, I've been googling, and have found a few bits, but was wondering if there were C++ libraries out there that would do that.

I'm developing using Visual C++ 2010, and the target environment is a Windows box.

Either that, or i'm going to need to take some physics lessons.


回答1:


Unfortunately, developing a system like the one your talking about would be insanely difficult. On the plus side, there are alot of easy to use technologies that will help you attain your goal hopefully.

Generally, the way that this type of thing works is as follows: You make some 3d asset in a modeling program such as Blender, 3ds max, Maya, Softimage, etc, and then use this in your program/game. You can think of these programs as just spitting out a bunch of 3d coordinates, which your program, with the help of OpenGL or DirectX can load into memory and render.

Modeling and loading assets is of course the alternative to developing algorithms to generate points. This is what it seems like your trying to accomplish.

The bad news is that clothing is really really complicated. A big part of this is due to the fact that most of it requires simulating cloth dynamics. Another part of the problem is that even if you had a 2d pattern, how would you the manner in which the clothing would adhere to your human model? Is it skin tight? Loose? How will you parameterize that? The placement of the actual clothing on the body is a chore in and of itself as anyone with experience in 3d modeling might tell you.

Nevertheless, some of the industry's brightest professionals are looking for both better ways to simulate cloth, and better ways to automate asset creation.

In summation, the easy answer is that what your trying to do, as interesting and noble as it may be, is going to be extremely difficult and may not have the result your looking for.

As for where you can go for more answers:

If your still intersted in finding a way to automate clothing attatchment to models, I would start by looking around academic websites. Look for any computer science departments which have computer graphics research programs. You will find alot of interesting things there.

For more academic type resources look at Game Programming Gems, GPU Programming Gems, and Graphics Programming Gems book series. They feature many good articles that tackle difficult graphics problems such as these.

Another thing you might do is check out blender a little more. There is an interesting project called MakeHuman

http://makehuman.blogspot.com/

That automates the process of developing human models in blender.

There are a couple of tutorials for putting clothing on the models, take a look at this one: http://www.davidjarvis.ca/blender/tutorial-05.shtml

For more tutorials on clothing and cloth simulation in blender, you can always check out

www.blendercookie.com cg.tutsplus.com

I hope some of this has been useful.




回答2:


From what I remember, cloth is simulated as a mesh of springs which suggests physics libraries for the simulation along with an understanding of the physics of springs/cloth. I've not heard of a physics library tailored to cloth simulation though, but no doubt someone on this site will know of one.




回答3:


It's answer about cloth simulation itself. (maybe it is not you're intersing in)

If you want to model cloth simulation by some vendors middleware - you can try to use

  1. Havok(it's commercial). It seems to me, that is supports any collision objects, represented by a triangle mesh.
  2. PhysX (it's free), but when you will try to use it there is a lot of constraints on it).

If you want to model cloth physics by you hands I can advise to you this steps:

  1. Refresh base knowledge about physics (Interia, Energy, Newton's law.)
  2. Good start point fo cloth simulation and also physics simulation is that book http://www.amazon.com/Game-Physics-Pearls-Gino-Bergen/dp/1568814747
  3. Read articles from Siggraph about clothes.
  4. Think about which collision objects do you need
  5. Think about what forces do you need.
  6. Split this challenge to Broad Phase / Integration / Collision Detection / Collision Response / Constrain Solver

I have developed cloth physics simulation in C++, OpenCL. It takes me about 4 months to develop, and about 2 months to Debug stage5. But it was very hot-time in my life, the job has consumed huge amount of time.




回答4:


except the part that you want to change the dummy while application is running what you want is more or less the example of game engines like Esenthel Engine. the whole idea is to load a mesh for the body and then put a "cloth" (cloth is already defined in most game engines as physical type) on it. but when it come to runtime changes in human frame it becomes a little more tricky since you have to know how you are going to affect the parrameters which is not easy of organic shapes.




回答5:


Free Game engine to use these days is Unity 3d ... as well it all depends in the detail and as well Maya and 3ds Max are the best of the modeling programs.



来源:https://stackoverflow.com/questions/5247157/modelling-clothing-in-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!