Methods of creating stairs

Hello there,

I am interested in creating architecture, at the moment I am starting with basic rooms and stairs.
The function that I have for creating the stairs works kinda okay but I was wondering if someone (better at maths) could offer some improvements or how other people are creating stairs.
Here is my playground example

Ideal I would like the stairs to have a straight boxed-end like this:

Once I have created stairs, and rooms, I would like to create a FreeCamera with collisions so I can explore the 3D world, so I have been considering 1) Will the camera be able to climb the stairs 2) Would it be better to create a wedge for the camera to climb?.. But first thing’s first…

Once I am done with my lil project I will open source it.

You should be able to use shape extrusion to create this staircase with less triangles than using boxes: Extruding Shapes | Babylon.js Documentation

1 Like

Thanks for your suggestion.
After a lot of trial and error I created a stairs function in the play ground


Thank you, that is helpful!

Well, I use a little addon for Blender that allows quick and simple staircase creation. Creates straight or curved stairs:

Creating Stairs with a Blender addon

The addon can be found here

The stairs are UV mapped so it is quite easy to add textures.

But maybe you want to do it in just code.

Stay Safe, gryff :slight_smile:

1 Like

Thanks that is great!

I have been thinking about curved stairs, I wonder if it would be possible (or allowed by the licence) to take the code in and port it to Type/JavaScript for Babylon?

Well, you could contact the guy who wrote the code and ask. And it is an Apache 2 licence which has a lot of leeway - but I’m not a lawyer.

Stay Safe, gryff :slight_smile:

Thanks that’s handy!.. Now all I have to learn basic Python.
I’m sure that chap won’t mind me nicking his curved stairs function.