Possible to deform a mesh object?

scotti_devscotti_dev Posts: 4Member

Hello. Is it possible to programically deform a mesh? By deform, I do not mean the individual vertices, but instead move the corners of an object so that it will deform to fit.

For example, if an object was imported from blender, could some of the virtual outer corners be moved slightly so that the whole object would deform?

Hopefully that make sense, if not let me know ;)


Tags :

Answers

  • CalinouCalinou Posts: 961Admin Godot Developer

    You could probably use a skeleton (with appropriately painted weights on vertices) or a custom shader to achieve this.

  • cyberealitycybereality Posts: 2,089Moderator
    edited September 18

    What you are asking for is called a Lattice. Maybe that will help you search.
    https://docs.blender.org/manual/en/latest/animation/lattice.html

  • MegalomaniakMegalomaniak Posts: 4,034Admin

    A vertex shader should be able to do this.

  • scotti_devscotti_dev Posts: 4Member

    Thanks everyone, I will do a bit of reading on those, I think they should work (vertex shader should do it, just wasnt sure what words to google) <3

  • cyberealitycybereality Posts: 2,089Moderator

    Yes, the vertex shader will work. If you only want to change the scale (meaning the outer cube will always be a cube shape, or at least rectangular) then it is pretty easy math. However, if you want to alter the outer cage arbitrarily (for example only moving one vertex to make a pointy edge or turning a cube into a pyramid) then it becomes more complex.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file