Giter Site home page Giter Site logo

Comments (2)

Cookiereg avatar Cookiereg commented on August 25, 2024 1

Yeah that sounds quite logical. I did what you said and recalculated the pivot point, that solved my problem.
Thanks for the quick reply :)

from ezy-slice.

DavidArayan avatar DavidArayan commented on August 25, 2024

Greetings Cookiereg,

Just want to make sure that I understand the question. Do you mean that the pivot points of the hulls stay the same as the original mesh when cut? If so then that's intentional.

If you look through the code, the Slicer always cuts the mesh in its own local coordinates, think of this as undoing all of the transformations before slicing and then re-applying the transformations after slicing. This means that the pivot of the hulls will be the same as the original mesh.

If you wish to re-calculate a proper pivot point, you would need sum all of the vertices and divide by the number of vertices in the mesh. The resulting point can be used to offset all of the vertices manually which will give you a pivot point roughly in the middle of the mesh. There is no need to add this extra overhead as part of the slicer as it overcomplicates things and adds extra computational cost. Luckily the slicer returns a familiar GameObject and a Mesh which is all Unity3D API's, so take the output and modify as you please!

Hope i've understood the question and hope that helps!

from ezy-slice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.