How to create a triangular pyramid?
TetrahedronBufferGeometry what you are looking for?
Yes, exactly this one, thanks
I have used this example, but I’m getting one error, i.e. Property ‘parameters’ does not exist on type ‘TetrahedronGeometry’.ts(2339)
No idea why this happens. Please demonstrate the issue with a live example.
The object is not coming as proper pyramid as in example.
I have used these values for first two parameters :
const vertices = [
1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1 ]; const indices = [ 2, 1, 0, 1, 3, 0, 0, 3, 2, 2, 3, 1 ];
Should I make some changes?
I had a look at this and that’s great
But still I’m unable to understand, why I’m not getting proper triangular pyramid
I have followed this link:
and radius=10 and detail=0
If you add two more triangles in this example https://hofk.de/main/discourse.threejs/2017/BufferGeometry/BufferGeometry.html , you have a tetrahedron.
You can adjust the values as you like.
Note .addAttribute is now .setAttribute
From the collection