Comments (8)
Hello @xCured2,
The Example Scenes are just that, example code to show you how the slicer works. They are not part of the core framework.
When you import the Slicer framework, there are various extension methods which you need to use to cut objects. The one most suitable for you is the gameObject.Slice(worldPosition, worldDirection). So you will need to do the following.
- Detect a Collision between the tree and the sword
- Grab the tree GameObject, ensuring it has the MeshFilter with a mesh in it (describing the tree)
- Grab the position and orientation of your sword and call tree.Slice(swordWorldPosition, swordWorldDirection).
- Grab the sliced GameObject (if any) and do whatever you'd like to do. You may need to manually destroy your tree and re-instantiate the returned GameObject's.
All things given, the slice should be a single line of code.
Keep in mind that the Slice returns new objects which you will need to re-attach any scripts into (if you had any on the tree).
Hope that helps!
from ezy-slice.
That indeed helped a lot! I was just unsure on how to exactly use this but that comment has it all figured out for me!
Thank you!
from ezy-slice.
Hi,
I've got a similar question:
I want to slice an object in either the x axis or the y axis. (Worlddirection)
For the Worldpoint I define a point on the object (chosen with a airtab on the object)
If I do so, the object is always sliced with the same plane for different points on the object.
What am I doing wrong?
from ezy-slice.
@superbuck The Plane you use to slice also has a rotation defined, the point only defines the position, you also need to define the rotation. Rotation is arbitrary and will change the axis that the slice occurs, check some of the samples on how it's done, cheers!
from ezy-slice.
Why do I ned to define the rotation?
Just that I get it right: with the Position one defines the a point on the cutting plane and with the Direction one defines the normal to the plane. With this a cutting plane should be created at the defined Position with alignment to the normal, is this right?
from ezy-slice.
Correct, The normal defines the facing direction of the plane, essentially it's rotation in 3D space. So just make sure the normal that you provide is actually a normalized vector.
from ezy-slice.
Thank you, that helped with that problem.
Another issue witht the Ezyslice Toolbox:
When I cut my object, then at some places there are "holes", so no mesh is generated, where before was an mesh. Do you have any suggestion to solve this problem?
from ezy-slice.
Hello,
That sounds like a bug, if you could open a new bug report issue and post a screenshot of the problem occurring that would be fantastic! thank you.
from ezy-slice.
Related Issues (20)
- Apply to Animated Model? HOT 5
- Bug: wrong slice direction when object we want to cut has different localscale on axis HOT 1
- If a mesh does not intersect the cutting plane it would be nice if I was told if it was on the upper or lower side. HOT 3
- How to test an example project?
- The name 'Normal' does not exist in the current context HOT 1
- Script Doesn't Link To Editor HOT 2
- Oculus Quest crashing HOT 7
- Slicing Unity's sphere results in meshes with uncovered holes HOT 5
- When cutting a complex mesh, the face does not respect the geometry HOT 1
- Get the intersection points HOT 2
- Lost HOT 4
- Doesn't work for more complex objects HOT 6
- After slicing the game object the original prefab holes are closed , the region is filled? i wanted to know if we can retain the original holes in the obj after slicing the game object ? HOT 3
- Ezy Slice - imported objects don't get sliced HOT 4
- Randomly doesn't slice (this could well be user error) HOT 2
- Can't download the project through unity git system. HOT 1
- [bug]Cut a hollow object in the middle. The object after cutting is incorrect HOT 1
- I'm curious. This object is not complex, but it can't be cut HOT 1
- Unexpected hole patching after slice HOT 1
- how can i add internal material to sliced object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ezy-slice.