Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

How to extrude a certain triangle in a mesh in three.js

$
0
0

Description:

My three.js scene is based upon a selection tool in which if we click and drag over the mesh it colors the triangles of the mesh red, I want to create a function that when runs checks the mesh.geometry.attributes and if it finds a triangle with red color it extrudes that triangle.

I am not good at attribute transformation and modification so I would love to get an explanation as well as how to perform this action in detail.

Furthermore, here is the selection part:

Selection

The red part is the selected area, I want to perform the extrusion like this:

Before extrusion

After Extrusion

Thanks in advance for the help!

What I tried:

I tried multipying and adding the normal of the triangle and then triangulating the edges but seem to get errors or just scattering of all the triangles inside the mesh.


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>