Page 1 of 5 123 ... LastLast
Results 1 to 20 of 92
  1. #1
    Member Atom's Avatar
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    11,632

    Fiber Mesh Emulation

    Hi All,

    I ran across this neat C4D freebie file and wondered how can we achieve that look in Blender?
    Name:  fiber_man.png
Views: 6304
Size:  135.3 KB

    The C4D file is using a python script and a ray caster to bounce around inside the model creating a spline as a result.

    I setup a similar approach in Blender using the particle system inside the mesh. I have inverted the mesh normals and turned it into a collision object. The particles do bounce around inside the mesh. Then I ran the bTrace AddOn to trace out the particle paths.
    Click image for larger version. 

Name:	btrace.jpg 
Views:	348 
Size:	24.6 KB 
ID:	298762
    As you can see, the particles don't really reach the extremities like the hands and fingers.

    Does anyone have any ideas on how to improve this technique?
    Attached Files Attached Files
    Last edited by Atom; 29-Mar-14 at 09:57.
    I rarely use Blender anymore.
    Houdini Indie is only $200.00 and Apprentice is free!
    Atom's Links Page



  2. #2
    could you use multiple "rounds" of bouncing, so that in the first round it bounces particles through the whole mesh, then in the second round it only bounces in a vertex group that has the extremeties, and in the third round it only bounces in a group that has the extreme extremeties?



  3. #3
    Member 3pointEdit's Avatar
    Join Date
    Sep 2005
    Location
    Brisbane, Australia
    Posts
    8,485
    Hmm. hair particles wrapped on an interior? Pretty cool effect.
    Cheers, David ___________"awesome in space and other places".
    ________Follow me on twitter @3pointedit
    _____________ Check the Youtube Channel for tutorials. Or my Sketchbook



  4. #4
    Member swmo's Avatar
    Join Date
    Oct 2012
    Location
    UK
    Posts
    517
    How about several wire frame modifiers, displaced with a cloud texture?



  5. #5
    Originally Posted by swmo View Post
    How about several wire frame modifiers, displaced with a cloud texture?
    Very cool approach



  6. #6
    Member Atom's Avatar
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    11,632
    I don't think a modifier or texture based solution is what I am after. The main reason is that I want to animate the stroke over time to make the mesh appear. With that in mind I reduced the particle count to 1. This way when I trace a single particle I will have a curve that can be animated over time to reveal the fiber mesh. I tried using a force field to force the zero velocity particle to move around inside the mesh. This does work but it is very hard to control. I tried switching to Boids following a goal but collision objects do not work with boids the same way they work with Newtonian.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screen Shot 2014-03-28 at 11.01.01 AM.png 
Views:	150 
Size:	346.3 KB 
ID:	298880  

    Attached Files Attached Files
    Last edited by Atom; 28-Mar-14 at 10:25.
    I rarely use Blender anymore.
    Houdini Indie is only $200.00 and Apprentice is free!
    Atom's Links Page



  7. #7
    Member SterlingRoth's Avatar
    Join Date
    Mar 2006
    Location
    Portland, OR
    Posts
    1,801
    If you wanted to go back to multiple fibers, you could have them emitting from the mesh itself and add a vertew group to weight it. then you could have fibers starting at the extremities and then tangling up inside the mesh. Just my $0.02
    The BlenderArtist formerly known as Mexicoxican



  8. #8
    Member Atom's Avatar
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    11,632
    The goal is to achieve that spun look. Here is my third attempt. I went back to just using the single vertex emitter and I animated it through the mesh to try to influence the particles into the limb extremities. It kind of worked but I still don't think it has the feel of being wrapped around like the C4D version does.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	fiber_man.jpg 
Views:	181 
Size:	151.4 KB 
ID:	298990  

    Attached Files Attached Files
    Last edited by Atom; 28-Mar-14 at 22:30.
    I rarely use Blender anymore.
    Houdini Indie is only $200.00 and Apprentice is free!
    Atom's Links Page



  9. #9
    how about make big coils around say all edge loops, shrinkwrap them to the mesh, displace a bit, repeat for the second color, then bounce a couple inside? this will not work for animations though...



  10. #10
    Member
    Join Date
    Mar 2010
    Posts
    1,107
    I had to give it a try Atom, here's a script you can improve: https://db.tt/uEkGeqMg



  11. #11
    Member
    Join Date
    Sep 2004
    Location
    Milan
    Posts
    1,234
    Really interesting effect,great work Atom(and also liero)



  12. #12
    Member swmo's Avatar
    Join Date
    Oct 2012
    Location
    UK
    Posts
    517
    Looking really cool now. One thing the reference image has - the spins around seem to be mainly horizontal around the body and vertical along the arms - basically it is at a tangent to the way the body flows. Any way you could use forces or something to make it flow like that?



  13. #13
    Member Atom's Avatar
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    11,632
    @Liero: Wow thanks! That script makes the process of achieving the look much easier. Now it is about tweaking some parameters based upon the mesh geometry. Do you mind if I turn this code into a Blendgraph node?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	fiber_man.jpg 
Views:	131 
Size:	193.8 KB 
ID:	299085  

    Attached Files Attached Files
    I rarely use Blender anymore.
    Houdini Indie is only $200.00 and Apprentice is free!
    Atom's Links Page



  14. #14
    Member
    Join Date
    Mar 2010
    Posts
    1,107
    sure, no problem, and will try to improve it a bit also

    edit: did some tests with your file, reducing curve bevel and running scripts a couple of times with 2 mats looks better
    the c4d runs and renders amazingly fast but good part of the effect is in the shader
    Last edited by liero; 29-Mar-14 at 12:15.



  15. #15
    Member Atom's Avatar
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    11,632
    I have placed your first draft code into a Blendgraph node. Feel free to pull down the AddOn with the Fiber Node if anyone wants to try this out on their own meshes.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	fireber_sphere.jpg 
Views:	88 
Size:	414.7 KB 
ID:	299189  

    Last edited by Atom; 29-Mar-14 at 18:59.
    I rarely use Blender anymore.
    Houdini Indie is only $200.00 and Apprentice is free!
    Atom's Links Page



  16. #16
    Member
    Join Date
    Mar 2010
    Posts
    1,107
    that's cool, and it runs at a decent speed also, thanks...
    need to play a bit more with your blendgraph!



  17. #17
    Member Atom's Avatar
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    11,632
    @ Liero: What do think about this slight modification to the script?
    Code:
    def bounce(obj, number):
        dist = 10       # Make smaller jumps.
        points = []
        data = obj.data.polygons
        n = r.randint(0, len(data)-1)
        end = data[n].normal.copy() * -1
        start = data[n].center
        points.append(start)
    
    
        last_nor = [0.0,0.0,0.0]
        for i in range(number):
            end += noise(.25)
            hit, nor, index = obj.ray_cast(start, end * dist)
            if index == -1:
                # Instead of just giving up set the new start to our last end.
                hit = end
                start = end
            else:
                start = hit - nor / 10000
                end = end.reflect(nor).normalized()
            points.append(hit)
        return points
    Basically instead of one long cast till we hit a wall do a bunch of short jumps. If the ray_cast fails then the previous end point becomes the new start. I think this might help when it comes time to animate the growth of the line. Currently if the script encounters a long open path way you only get a single point along that section which causes a big jump in the line growth for animation.

    Just trying to balance the distance betweens points for smoothing growth animation.
    Last edited by Atom; 31-Mar-14 at 13:52.
    I rarely use Blender anymore.
    Houdini Indie is only $200.00 and Apprentice is free!
    Atom's Links Page



  18. #18
    Member
    Join Date
    Mar 2010
    Posts
    1,107
    Atom: modified the script to cast some extra rays if it hits nothing, it is usually because the mesh has holes so increasing the 'noise' could help too -had done a few other changes before that-

    check if this is what you wanted -or do it your way- also consider adding a seed option to gui: https://db.tt/uEkGeqMg

    edit: also learned you can map a gradient along the curve by enabling 'use uv' option...
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	bounces.jpg 
Views:	751 
Size:	434.3 KB 
ID:	299760  

    Last edited by liero; 01-Apr-14 at 09:11.



  19. #19
    Member Atom's Avatar
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    11,632
    Excelente!

    I was wondering about how to add a color ramp along a curve.

    I have integrated your recent code into the Blendgraph Fiber Mesh Node and added the random seed parameter as suggested (which helps keep the generation stable if you animate the node parameters). I have added a drop down with 3 ray-casting types now. Your initial code which I am calling 'Fast' my more evenly spaced one which I have labeled 'Spaced' and your revised code which I have labeled "Sampled". When you select sampled you get an extra parameter to specify the sub sampling amount.

    I am still playing around with the original code and wondered if you could see any caveats in randomly altering the reflection normal on hit?
    Code:
                rnd_nor = Vector((nor[0]+r.uniform(0.0,noise_value),nor[1]+r.uniform(0.0,noise_value),nor[2]+r.uniform(0.0,noise_value)))
                end = end.reflect(rnd_nor).normalized()
    It does seem to work as this image show a reflected bounce heading off at an odd angle.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screen shot 2014-04-01 at 12.42.48 PM.png 
Views:	97 
Size:	36.8 KB 
ID:	299784  

    Last edited by Atom; 01-Apr-14 at 11:54.
    I rarely use Blender anymore.
    Houdini Indie is only $200.00 and Apprentice is free!
    Atom's Links Page



  20. #20
    Member
    Join Date
    Mar 2010
    Posts
    1,107
    Atom I don't know if it makes much of a difference but it won't hurt. Seen the C4D example and there is no extra 'noise' in it. Maybe try changing angle only when it is too close to face normal? it looks good as it is anyway, I would try to keep it simple



Page 1 of 5 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •