Orientation of axis

78 views
Skip to first unread message

Erik K.

unread,
Aug 16, 2021, 1:51:32 AM8/16/21
to MathBox
Hi everyone,

Mathbox's camera by default has its upward orientation to +y direction ([0, 1, 0]). I want to make the z-axis pointed upwards, and this can be done by settings the camera's up position to [0, 0, 1]. However, by setting the up position to +z, it messes up the movement of the camera. 

Is there any way to set the z-axis upwards while maintaining the camera's correct rotation?

thanks

Erik K.

unread,
Aug 16, 2021, 2:01:27 AM8/16/21
to MathBox
Message has been deleted

Erik K.

unread,
Aug 17, 2021, 8:06:44 PM8/17/21
to MathBox
To those who are reading this from the future:

I couldn't find a nice solution, so I resorted to my initial hack which simply switched the order of coordinates from (x, y, z) to (x, z, y). This means that when drawing on the xy-plane, for instance, you would emit 3 channels: (x, 0, y) as opposed to 2 channels (x, y).

Hope this helps

Erik K.

unread,
Aug 23, 2021, 3:19:20 PM8/23/21
to MathBox
My apologies. It is easier to use the swizzle operator and set swizzle order = [x, z, y]

Michael

unread,
Jul 7, 2023, 4:21:33 PM7/7/23
to MathBox
Hi Erik, is the source of you using swizzle online somewhere? I'm having trouble with the area emit function, and when I try to adjust the limits of the "z"-scale, it's cutting off the emits for y points.
Message has been deleted

Sam Ritchie

unread,
Jul 7, 2023, 6:27:22 PM7/7/23
to Michael, MathBox
One thing I wrapped my head around recently is that, by default, MathBox treats x as left/right, y as up/down, and z as in/out. 

In the constructor, if you pass

camera: {up: new Vector3(0, 0, 1)}

like Chris does here:


then you can get rid of your swizzles etc.

On Fri, Jul 7, 2023, at 2:35 PM, Michael wrote:
Sorry -- moments later I find that `area` has primitives `rangeX` and `rangeY` to control the sampling emit points independent of the viewed cartesian axis range.
--
You received this message because you are subscribed to the Google Groups "MathBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathbox+u...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages