Using Math.PI to set a mesh rotation in the Editor

I thought I would work through the docs tutorials (building a house then a village) but using the Editor rather than just writing TS so that I would learn the Editor at the same time. However I don’t see a way to specify that a cylinder mesh has a rotation of Math.PI/2 in the Editor. I also don’t see a tesselation property. Is it possible to set these in the Editor or should I open VS Code and try to add the properties there?

Adding @julien-moreau the editor s daddy

1 Like

Hi @MattGreenslade !

Unfortunately the cylinder has no options exposed in the Editor at the moment. I’m adding it to the todolist and will be available next release! Just created the issue here: Add options for Cylinder Geometries · Issue #309 · BabylonJS/Editor · GitHub

For the rotation, in the inspector, the X,Y and Z fields are expressed in degress. That means if you want to put Math.PI/2 then you can put 90 which represents “90 degrees”.

At the moment you can use VSCode and attach a new script on the cylinder mesh that will modify “by code” the geometry’s data like this code: Editor/ground-inspector.tsx at master · BabylonJS/Editor · GitHub
Where in the script you would have

this.geometry?.setAllVerticesData(VertexData.CreateCylinder({ ... }) // Or something like that
1 Like

That is really helpful thanks. I like the idea of attaching a script too and I will try that.