Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blender Exporter: Camera's Y position gets negated. #4207

Closed
kayomarz opened this issue Dec 13, 2013 · 7 comments
Closed

Blender Exporter: Camera's Y position gets negated. #4207

kayomarz opened this issue Dec 13, 2013 · 7 comments
Labels

Comments

@kayomarz
Copy link

Blender exporter seems to negate the value of the y position of the camera.

Note: This is not related to the Flip YZ feature.

Apart from this, the exporter works great.

Blender version: 2.69.0 (r60991)
Three.js revision: 63

The property pane of the default blender scene shows the camera position as: 7.48113, -6.50764, 5.34367

Blender exporter exports it as: 7.48113, 6.50764, 5.34367

Following is a snipped of the default blender scene exported using blender exporter. (Note that Flip YZ is enabled.)

    "Camera" : {
        "type"  : "PerspectiveCamera",
        "fov"   : 49.159264,
        "aspect": 1.333000,
        "near"  : 0.100000,
        "far"   : 100.000000,
        "position": [ 7.48113, 5.34367, 6.50764 ],
        "target"  : [ 0, 0, 0 ]
    }

After digging into the python code, line number 2178 shows that the y position is explicitly negated.

Wondering if there's any reason for negating it or maybe just a typo?

@ghost
Copy link

ghost commented Dec 13, 2013

In what way is 5.34 a negated value? unless i'm missing something.. ?

On Fri, Dec 13, 2013 at 2:52 PM, Kayomarz notifications@github.com wrote:

Blender exporter seems to negate the value of the y position of the
camera.

Note: This is not related to the Flip YZ feature.

Apart from this, the exporter works great.

Blender version: 2.69.0 (r60991)
Three.js revision: 63

The property pane of the default blender scene shows the camera
position as: 7.48113, -6.50764, 5.34367

Blender exporter exports it as: 7.48113, 6.50764, 5.34367

Following is a snipped of the default blender scene exported using
blender exporter. (Note that Flip YZ is enabled.)

"Camera" : {
    "type"  : "PerspectiveCamera",
    "fov"   : 49.159264,
    "aspect": 1.333000,
    "near"  : 0.100000,
    "far"   : 100.000000,
    "position": [ 7.48113, 5.34367, 6.50764 ],
    "target"  : [ 0, 0, 0 ]
}

After digging into the python code, line number 2178https://github.com/mrdoob/three.js/blob/master/utils/exporters/blender/2.65/scripts/addons/io_mesh_threejs/export_threejs.py#L2178shows that the
y position is explicitly negated.

Wondering if there's any reason for negating it or maybe just a typo?


Reply to this email directly or view it on GitHubhttps://github.com//issues/4207
.

@kayomarz
Copy link
Author

-6.50764 gets negated to 6.50764

@mrdoob
Copy link
Owner

mrdoob commented Dec 13, 2013

I'm a bit out of touch with that exporter. Maybe @joostfaassen knows what the problem is?

@kayomarz
Copy link
Author

After removing the explicit negative sign on line 2178 it seems ok. I wonder if it's needed in some situation or might be a typo.

Line 2178:

"position"  : generate_vec3([cameraobj.location[0], -cameraobj.location[1], cameraobj.location[2]], data["flipyz"])

@mrdoob
Copy link
Owner

mrdoob commented Dec 19, 2013

If you could do a few test and double check that it works, a PR with the fix would then be great :)

@kayomarz
Copy link
Author

kayomarz commented Feb 9, 2014

The reason for explicitly negating the value is unknown. Removing the negation seems to work. Making a PR incase you would like to use it.

@Mugen87
Copy link
Collaborator

Mugen87 commented May 31, 2018

The JSON Blender exporter has been removed with R93 (#14117).

Also see: https://threejs.org/docs/#manual/introduction/Loading-3D-models

@Mugen87 Mugen87 closed this as completed May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants