Which way is up?

Discussion related to the Engine functionality, implementations and API.
User avatar
Continuum
Posts: 4
Joined: Mon Dec 02, 2019 11:16 pm
Location: Zambia

Which way is up?

Post by Continuum » Mon Dec 02, 2019 11:20 pm

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.

User avatar
Dade
Developer
Posts: 3421
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Which way is up?

Post by Dade » Tue Dec 03, 2019 8:43 am

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.
Support LuxCoreRender project with salts and bounties

User avatar
Continuum
Posts: 4
Joined: Mon Dec 02, 2019 11:16 pm
Location: Zambia

Re: Which way is up?

Post by Continuum » 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.

User avatar
Dade
Developer
Posts: 3421
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Which way is up?

Post by Dade » Tue Dec 03, 2019 3:39 pm

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).
Support LuxCoreRender project with salts and bounties

User avatar
Continuum
Posts: 4
Joined: Mon Dec 02, 2019 11:16 pm
Location: Zambia

Re: Which way is up?

Post by Continuum » Tue Dec 03, 2019 5:04 pm

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.

User avatar
Continuum
Posts: 4
Joined: Mon Dec 02, 2019 11:16 pm
Location: Zambia

Re: Which way is up?

Post by Continuum » 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.

User avatar
FarbigeWelt
Donor
Posts: 893
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Which way is up?

Post by FarbigeWelt » Thu Dec 05, 2019 10:42 am

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.
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
160.8 | 42.8 (10.7) Gfp | Windows 10 Pro, intel i7 4770K@3.5, 32 GB
2 AMD Radeon RX 5700 XT, 8 GB || Gfp = SFFT Gflops

Racleborg
Posts: 544
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Which way is up?

Post by Racleborg » 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

User avatar
Dade
Developer
Posts: 3421
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Which way is up?

Post by Dade » Thu Dec 05, 2019 10:54 am

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.
Support LuxCoreRender project with salts and bounties

User avatar
FarbigeWelt
Donor
Posts: 893
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Re: Which way is up?

Post by FarbigeWelt » Thu Dec 05, 2019 11:34 am

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.😎
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
160.8 | 42.8 (10.7) Gfp | Windows 10 Pro, intel i7 4770K@3.5, 32 GB
2 AMD Radeon RX 5700 XT, 8 GB || Gfp = SFFT Gflops

Post Reply