Page 1 of 2

Which way is up?

Posted: Mon Dec 02, 2019 11:20 pm
by Continuum
Firstly I would like to thank everyone working on LuxCore. It's a brilliant render engine, and you've made it accessible for everyone. Cheers

Just getting comfortable with the C++ API. Finally got something to render. My first question is which way is up (X,Y,Z)? And is it possible to change ? I'm using OpenGL conventions, +Z goes into the screen.

Re: Which way is up?

Posted: Tue Dec 03, 2019 8:43 am
by Dade
Continuum wrote:
Mon Dec 02, 2019 11:20 pm
Just getting comfortable with the C++ API. Finally got something to render. My first question is which way is up (X,Y,Z)? And is it possible to change ? I'm using OpenGL conventions, +Z goes into the screen.
The up vector is defined by property "scene.camera.up" and the default value is (0.0, 0.0, 1.0) so X/Y is the floor and Z is up like in Blender.

Re: Which way is up?

Posted: Tue Dec 03, 2019 2:08 pm
by Continuum
Okay thanks I noticed this. So I could change the up vector to Y and everything will be fine? Or do I need to transform my scene to instead. I only ask because I noticed that the Sky light horizon uses Z as up.

Re: Which way is up?

Posted: Tue Dec 03, 2019 3:39 pm
by Dade
Continuum wrote:
Tue Dec 03, 2019 2:08 pm
Okay thanks I noticed this. So I could change the up vector to Y and everything will be fine? Or do I need to transform my scene to instead. I only ask because I noticed that the Sky light horizon uses Z as up.
"scene.camera.up" will change only what the camera up vector, as you have noticed with sky light source, there may be other places where you have to set what is conspired "up" (however it should be limited to camera and environment light sources).

If you are importing some existing scene, it may be simpler to set camera/sky/sun/etc. "up". If you are creating some new scene from scratch, I would suggest to use the default Z-is-up convention (common to most 3D modeler).

Re: Which way is up?

Posted: Tue Dec 03, 2019 5:04 pm
by Continuum
I am importing data into LuxCore, and the source app uses Y as up. Silly question how do you set a Sky Light source up (or other items in the scene). There is no property (I am using the luxcorescenedemo as a reference.) I have tried transforming the light, setting the direction property, but the horizon never changes.

Re: Which way is up?

Posted: Wed Dec 04, 2019 6:52 am
by Continuum
Anyway I think I've managed to solve this by parenting the scene and rotating it 90 degrees. Things seem fine so far.

Re: Which way is up?

Posted: Thu Dec 05, 2019 10:42 am
by FarbigeWelt
Continuum wrote:
Wed Dec 04, 2019 6:52 am
Anyway I think I've managed to solve this by parenting the scene and rotating it 90 degrees. Things seem fine so far.
Good. This is the solution I had recommended you. Seems to be the easiest and most reliable way to me.

Re: Which way is up?

Posted: Thu Dec 05, 2019 10:48 am
by Racleborg
Is this issue the same as the one that I'm having importing baked textures to Blender from the luxcoreui?
Using Blender’s default cube, which is already unwrapped, then the baked textures created in Luxcoreui need to be rotated by 180° (z axis (from top view)) then scaled by *-1 (x axis) when re -imported back to Blender in order to retain its original position.
Thanks

Re: Which way is up?

Posted: Thu Dec 05, 2019 10:54 am
by Dade
Racleborg wrote:
Thu Dec 05, 2019 10:48 am
Is this issue the same as the one that I'm having importing baked textures to Blender from the luxcoreui?
It is likely, BlendLuxCore does the job to translate the images under the hood. You need just to use an UV mapping scale of 1 for U and -1 for V (it will flip the V), as far as I remember.

Re: Which way is up?

Posted: Thu Dec 05, 2019 11:34 am
by FarbigeWelt
Racleborg wrote:
Thu Dec 05, 2019 10:48 am
Is this issue the same as the one that I'm having importing baked textures to Blender from the luxcoreui?
Using Blender’s default cube, which is already unwrapped, then the baked textures created in Luxcoreui need to be rotated by 180° (z axis (from top view)) then scaled by *-1 (x axis) when re -imported back to Blender in order to retain its original position.
Thanks
If you are used to 2D graphics then you should know that y axis is vertical and x axis horizontal. Computer based 0,0 is top left because e-beam monitors used to start, the beam run left right and top to down. In mathematics 2D x,y is horizontal, vertical and 0,0 is in left bottom corner, what makes sense because a linear expression like f(x)->y=ax+b is drawn often with x0=0, x1=1, x2=3, etc. (most simple case a=1, b=0 what leads to rectangular triangle with two equal sides x0xn=y0yn.
Now, the big question is how would add the 3 dimension?
a) In computer graphics, you can add a third dimension with a rather simple trick, namely with special glasses, because if each eye sees the same scene but from a slightly different point of view you get a more or less deep or popping out 3D picture. z axis is therefore from front to back or versa vice.
b) Because you are a skilled artist you like to draw a nice 3D sphere and a cube in a perspective correct drawing. But your paper is flat an lies on the table. Like with the computer monitor you add an additional axis getting rectangular through the paper. Obviously, you can not draw like this. So, you step back from your table with paper showing the x,y coordinates. To help your imagination you put a ball and a cube on the paper and start drawing the the scene in front of you on another sheet. Where do you place the z-axis now? Exactly! x axis keeps horizontally, y axis runs to the perspective point above or below the x axis and z is therefore vertical.

Both point of views are natural and logic.😎