Search Unity

Trying to Rotate Vertices in Forward Direction

Discussion in 'Scripting' started by idcanu, Dec 11, 2018.

  1. idcanu

    idcanu

    Joined:
    Jul 3, 2017
    Posts:
    14
    Hello Guys here i'm trying to move the vertices in forward direction while they are rotating but i m nowhere near a proper solution any help will be appreciated , i want to do something like this the more i push it the more it bends is there any way to do it with Scripting without help of any asset
    i tried to do this on my own but i m nowhere near a solution my mesh keeps going in wrong direction, any help will be appreciated and i have done basic related to procedural mesh generation from unity documentation. AAkash.PNG
     
  2. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,089
    It's expensive but I've used the Mega-Fiers plugin before and it's great for that kind of thing:

     
  3. idcanu

    idcanu

    Joined:
    Jul 3, 2017
    Posts:
    14
    @tonemcbride can you guide me how can to do it. i have already watched this video and used this asset but couldn't Produce the same result as this can you guide me how to do this exact same thing most probably i want to do it with my own code but if asset is any use any help will be appreciated
     
  4. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,089
    I wouldn't know how to do that easily in code unfortunately - the mega fiers plugin comes with a test scene though that has an example of the page rolling up.
     
  5. idcanu

    idcanu

    Joined:
    Jul 3, 2017
    Posts:
    14
    @tonemcbride Could you give me the path in the project folder where is this page rolling up demo is stored at , does it have the same carpet demo too?Included in the Project files
     
  6. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,089
    Sorry, I don't have that plugin anymore - I worked on it years ago on another project. From what I remember they only had one demo scene though so just do a search for scenes and you should find it.
     
  7. idcanu

    idcanu

    Joined:
    Jul 3, 2017
    Posts:
    14
    @tonemcbride Thanks for the reply but it's complex asset to understand and i managed to bend the object using matrix its not as proper as asset but still it turns into a roll thanks man will contact you if i have some other query
     
    tonemcbride likes this.
  8. ahmedarshadcoll

    ahmedarshadcoll

    Joined:
    Nov 11, 2019
    Posts:
    7
    @idcanu Can you please guide me ho i can achieve bend like paper or carper through matrix please , i also tried MegaFiers but its not working like in video
    i have no idea about matric
     
  9. idcanu

    idcanu

    Joined:
    Jul 3, 2017
    Posts:
    14
    @ahmedarshadcoll oh, it has been some time since I attempted it, but I did it using Matrix.TransformPoint3X4 and Passing Vertices Position into it, then again assigning the whole array of vertices that comes out of the Matrix Multiplication to its original mesh but it was too much performance intensive for mobile devices because the code was nowhere near ready, but now I would suggest you can try a better approach using ECS and job system for Mobile Device to bend or do anything with mesh Here is a reference if you want to attempt it using this asset on github https://github.com/keenanwoodall/Deform
     
  10. ahmedarshadcoll

    ahmedarshadcoll

    Joined:
    Nov 11, 2019
    Posts:
    7