IsoMesh | related tools for Unity for converting meshes | Service Mesh library
kandi X-RAY | IsoMesh Summary
kandi X-RAY | IsoMesh Summary
IsoMesh is a group of related tools for Unity for converting meshes into signed distance field data, raymarching signed distance fields, and extracting signed distance field data back to meshes via surface nets or dual contouring. All the work is parallelized on the GPU using compute shaders. My motivation for making this was simple: I want to make a game in which I morph and manipulate meshes, and this seemed like the right technique for the job. Isosurface extraction is most often used for stuff like terrain manipulation. Check out No Man's Sky, for example. I decided to share my code here because it represents a lot of trial and error and research on my part. And frankly, I just think it's cool. The project is currently being developed and tested on Unity 2021.2.0f1.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of IsoMesh
IsoMesh Key Features
IsoMesh Examples and Code Snippets
Community Discussions
Trending Discussions on IsoMesh
QUESTION
I have an icosahedron mesh which I am rotating and then adding circle geometries and setting their location to each vertex at every frame in the animation loop.
...ANSWER
Answered 2017-Apr-10 at 18:14The solution it multi-layered.
Your Icosahedron:
You were half-way there with rotating your icosahedron and its vertices. Rather than applying the rotation to all the vertices (which would actually cause some pretty extreme rotation), apply the rotation to the mesh only. But that doesn't update the vertices, right? Right. More on that in a moment.
Your Circles:
You have the right idea of placing them at each vertex, but as WestLangley said, you can't use lookAt
for objects with rotated/translated parents, so you'll need to add them directly to the scene. Also, if you can't get the new positions of the vertices for the rotated icosahedron, the circles will simply remain in place. So let's get those updated vertices.
Getting Updated Vertex Positions:
Like I said above, rotating the mesh updates its transformation matrix, not the vertices. But we can USE that updated transformation matrix to get the updated matrix positions for the circles. Object3D.localToWorld
allows us to transform a local THREE.Vector3
(like your icosahedron's vertices) into world coordinates. (Also note that I did a clone of each vertex, because localToWorld
overwrites the given THREE.Vector3
).
Takeaways:
I've tried to isolate the parts relative to your question into the JavaScript portion of the snippet below.
- Try not to update geometry unless you have to.
- Only use
lookAt
with objects in the world coordinate system - Use
localToWorld
andworldToLocal
to transform vectors between coordinate systems.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install IsoMesh
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page