Skip to content

Exported lights point in the "wrong" direction #231

Open
@sercero

Description

@sercero

Hello, @paroj.

While developing the ability to export rectangular lights, it came to my attention an issue regarding the exporting of lights.

Suppose we have a scene with a cube and a directional light of type "Sun".
image

By default in Blender a light with identity transform will have the light pointing downwards.

If we export the scene to OGREs coordinate system, and since blender2ogre does a conversion where x->x, y->z, z->-y,
then the result is that the cube now is in position (1, 0, -1) and the light is pointing towards -Z.
image

This is because since the light had identity transform in Blender its transform will not change in OGRE.
But the thing is that in OGRE the light will point towards -Z because that is what happens with a light that has no rotation.

I changed the code in scene.py so that the lights are the only objects transformed by a -90° rotation on the X axis.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions