after12am / eisenscript

A programming language designed for generating awesome structures.
https://after12am.github.io/eisenscript-docs/
MIT License
46 stars 5 forks source link

Strange irregular rotation and shearing of boxes #45

Closed kronpano closed 4 years ago

kronpano commented 7 years ago

I published my try-outs here (takes a bit to load and show the structure but it works - well - should work) The structure is a regular one - the script is

corner rule ARC maxdepth 66 { { z 0.85 rx 4.5 s 0.95 } ARC box } rule corner md 10{ { s 1 2 1.2 }ARC {ry 36}corner }

The problem is if you zoom in (mouse wheel) and look at the structure some arms are regular (1) but if you turn the structure (left click and drag/ right click shifts it) some are quite strange (2). arms

Not sure why that should happen if the script is just turn and rotate.

One - quite big difference to the original Structure Synth is that boxes are not sheared they stay boxes.

The following script 15 * {rx 10 x 1.1 s 1 1.3 1}box produces heavily sheared boxes in the original Structure Synth t2

but a tower of nice rectangular boxes in browser synth t1

This shearing also means that the structure I published on the website looks quite "rough" whereas in the original Structure Synth - due to the shearing - it is quite smooth image

Just saying

after12am commented 7 years ago

I have been doing my best for solution of this problem in past these three days. I wondered why this problem has been occurred. There is no bug causes this problem, however many times I checked my code. But I find the bug related to recursively rule calling instead. ( #48 ) This is fixed in v1.1.7.

I was bewildered, and then I checked transformation matrix which was getting after compiling the eisenscript code. I compared with the result which was got using another library that calculates transformation. The result is the same.

Finally, I decided to create sample using another 3d library except three.js. I used babylonjs. The result is here.

I have come a long way... I guess this problem has been caused by three.js.

For resolving the problem, you have to use the another 3d renderer. But I do not know the suitable renderer. Sorry,

default

after12am commented 7 years ago

Thanks a lot for your great consideration.

I think so too. I guess that the bug is disclosed when using scaling and rotation in the same time. It might be have the problem about calculating the transformation.

fecc7a4c-9644-11e6-9c63-0d0ef9d25d9c