# Simplest way to create oblique Pyramid

Hi All,
I want to create a Oblique Triangular Pyramid geometry (as well as a truncated version of the same) like https://slideplayer.com/slide/10286473/35/images/25/Regular+Square+Pyramid.jpg
. It looks like a custom geometry is the only way to go, but I was hoping there is some way to take one of the existing geometries like CylinderGeometryand skew it to make it oblique somehow. I noticed this page http://alexan0308.github.io/threejs/examples/#webgl_modifier_skew but can’t find a working source link.
Any recommendations?
(ps. these geometries are to stack to form a pyramid which has different number of meshes on each pyramid face).

I never tried it,
but the source is of course in the page you put the link to:
http://alexan0308.github.io/threejs/examples/js/modifiers/SkewModifier.js

2 Likes

Does a tetrahedron work for you?

https://threejs.org/docs/index.html#api/en/geometries/TetrahedronBufferGeometry

I don’t think so. I have independent meshes (top is cone, lowers cylinder geometry) composed so they build up to show as a pyramid. I have raycaster click interceptor to load custom html for each mesh:

Trouble is need to have say N layer on one pyramid face but N+3 on another - so my current solution fails here.
So I am going to try apporaches:-

• Easier - have two pyramid mesh groups rendered in the same place using ‘out of the box’ geometries, but assign invisible material to faces that need the alternative layer number.
• Harder (I think) - create custom geometries that divide the pyramid up per face. I believe this would be oblique trigonal pyramids (truncated for lower frustums). Although I expect this is a more technically correct solution?

This works for me but now the Raycaster intersector is still selecting the invisibe/transparaent face. The new material face has visble set to false (the objects visible property is still true). Shouldn’t the raycater respect the visible-ness of the face?