create hair locks with code ?

Community Forums/General Help/create hair locks with code ?

RemiD(Posted 2016) [#1]
Hello,

Has anybody already tried to do this ?
Instead of modelizing each hair lock manually (which takes too much time), generate them in code and put it along the head using linepick or something like that...

Any secret technique/tip ?


Flanker(Posted 2016) [#2]
Hello RemiD.

The question is : do you want the vertices of the hair to be welded with the head ? This would need CSG functions.

Otherwise you just position an editable base mesh several times with automatic left-right symetry then you make sure the vertices are in the head.


RemiD(Posted 2016) [#3]
No i don't need the vertices to be welded to the scalp nor to have closed shapes.

I was just curious of different methods to achieve this, but it seems that modeling manually will produce better results than trying to model procedurally because some hair locks will intersect with others and it can quickly become a mess.


RemiD(Posted 2016) [#4]
In some games (like in vampires bloodlines), it seems that they are using physics or some kind of real time update to position the locks of long hair around the scalp/head...


Flanker(Posted 2016) [#5]
What about this :)




RemiD(Posted 2016) [#6]
This looks nice but it must be a pain to modelize and to update. I don't have time for that ! I will probably use "hair helmets", ahahah :D


RemiD(Posted 2016) [#7]
So the method i used for the hair locks in post #1 was to duplicate some vertices of the head and then to position them slightly above the head, and then to create the triangles. Which was slow and annoying to do.

Here is another method that i am trying today :
the idea is to create a cylinder with 4 sides and 10 segments (or less or more) and then to delete the top triangles and bottom triangles of the cylinder, and then to position oriente the 4 vertices of each side of each segment along the head.
Then at the end i delete the unwanted segments and i create a vertex and 4 triangles at the end of each extremity to have a kind of pointy shape.
It is faster and less annoying to create a haircut this way.
Of course you could also choose to keep only the outside faces of the cylinder instead of all faces (so it would be only 6 vertices 4 triangles per segment instead of 8 vertices 8 triangles per segment)...


RemiD(Posted 2016) [#8]
Except it looks like dreads, not locks...

I think that i will probably create a game with robots, so that there i no need for hair ;)
or maybe create "hair helmets" like in Morrowind...


RemiD(Posted 2016) [#9]
method3 :

The idea is the same than method2 except i use a segmented flat rectangle (9 segments in this case) with for each segment 4 vertices, 2 triangles.

I like the result, it is fast enough to put around the head, and it is low tris.

The slight offset between each hair lock and the variable orientation of each flat rectangle produces different lighting/shading and thus they appear as different hair locks (without texture)

All good, no i will try with more complex haircuts...


Ian Thompson(Posted 2016) [#10]
Use wigs...




RemiD(Posted 2016) [#11]
@Ian>>Yes this one would be easy to create : 6 cylinders, 6 cones ;)


RemiD(Posted 2016) [#12]
final haircut :


but when i see this :


i realize how a noob i am concerning modeling/texturing...

at least it looks human...


AdamStrange(Posted 2016) [#13]
first off - don't despair. As humans we can detect event the tiniest thing wrong with a computer face.

next - use real images to work from. E.G.

or


here's a computer head without hair:


lastly. if you think that hair is the easy bit - WRONG. Hair is possibly one of the hardest thing to make look right. much much harder than modelling a face.
Though, the best thing is to look at the real thing and also good examples of computer hair and approximate:





RemiD(Posted 2016) [#14]
I used a front photo and a side photo as references, but it is not easy because if you add too many vertices/triangles then it is complicated and takes a lot of time to position/oriente them correctly and if you don't add enough vertices/triangles it looks too "cubical".

Your examples probably use a texture, my example does not (because texelsfilling/uvmapping/texturing takes too much time imo), so yes it looks less detailed/realistic.

But depending on the camera view (not first person), or if i add others graphics effects, it is probably good enough. I am not trying to compete with modern graphics anyway.


RemiD(Posted 2016) [#15]
New test to create a hair helmet :

(supposed to be "angel")