discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Why rotate() and $vpr use opposed rotation orders?

R
Ronaldo
Mon, Aug 8, 2016 9:11 PM

AFAIK, rotate([a,b,c]) is equivalent to:

rotate([0,0,c]) rotate([0,b,0]) rotate([a,0,0])

which is opposed to the usual Euler angle order. However, the angles
expected by $vpr assignments are taken in the inverse order: first Z, last
X.

I wrote a function to calculate the Euler angles of a viewport frame in
order to feed $vpr. But I cannot use it with rotate(). I would expect the
same rule in both.

--
View this message in context: http://forum.openscad.org/Why-rotate-and-vpr-use-opposed-rotation-orders-tp18092.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

AFAIK, rotate([a,b,c]) is equivalent to: rotate([0,0,c]) rotate([0,b,0]) rotate([a,0,0]) which is opposed to the usual Euler angle order. However, the angles expected by $vpr assignments are taken in the inverse order: first Z, last X. I wrote a function to calculate the Euler angles of a viewport frame in order to feed $vpr. But I cannot use it with rotate(). I would expect the same rule in both. -- View this message in context: http://forum.openscad.org/Why-rotate-and-vpr-use-opposed-rotation-orders-tp18092.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Mon, Aug 8, 2016 9:19 PM

On 08/08/2016 11:11 PM, Ronaldo wrote:

I wrote a function to calculate the Euler angles of a viewport frame in
order to feed $vpr. But I cannot use it with rotate(). I would expect the
same rule in both.

Say hello to legacy issues...

https://github.com/openscad/openscad/blob/master/src/Camera.cc#L41

ciao,
Torsten.

On 08/08/2016 11:11 PM, Ronaldo wrote: > I wrote a function to calculate the Euler angles of a viewport frame in > order to feed $vpr. But I cannot use it with rotate(). I would expect the > same rule in both. > Say hello to legacy issues... https://github.com/openscad/openscad/blob/master/src/Camera.cc#L41 ciao, Torsten.
RP
Ronaldo Persiano
Mon, Aug 8, 2016 10:05 PM

$vpr use Euler angle rotation order. The issue is the rotate() order.
Another legacy?

2016-08-08 18:19 GMT-03:00 Torsten Paul Torsten.Paul@gmx.de:

On 08/08/2016 11:11 PM, Ronaldo wrote:

I wrote a function to calculate the Euler angles of a viewport frame in
order to feed $vpr. But I cannot use it with rotate(). I would expect the
same rule in both.

$vpr use Euler angle rotation order. The issue is the rotate() order. Another legacy? 2016-08-08 18:19 GMT-03:00 Torsten Paul <Torsten.Paul@gmx.de>: > On 08/08/2016 11:11 PM, Ronaldo wrote: > > I wrote a function to calculate the Euler angles of a viewport frame in > > order to feed $vpr. But I cannot use it with rotate(). I would expect the > > same rule in both. > > > Say hello to legacy issues... > > https://github.com/openscad/openscad/blob/master/src/Camera.cc#L41 > > ciao, > Torsten. > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
M
MichaelAtOz
Mon, Aug 8, 2016 10:09 PM

It is easy to do your own e_rotare() module.


Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Why-rotate-and-vpr-use-opposed-rotation-orders-tp18092p18095.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

It is easy to do your own e_rotare() module. ----- Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/Why-rotate-and-vpr-use-opposed-rotation-orders-tp18092p18095.html Sent from the OpenSCAD mailing list archive at Nabble.com.