forked from bartvdbraak/blender
COLLADA: fix for #32251. This seems to be compliant to the Collada 1.4.1 specification.
This commit is contained in:
parent
021dd5fb40
commit
9090340175
@ -84,7 +84,7 @@ void CamerasExporter::operator()(Object *ob, Scene *sce)
|
|||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
COLLADASW::OrthographicOptic ortho(mSW);
|
COLLADASW::OrthographicOptic ortho(mSW);
|
||||||
ortho.setXMag(cam->ortho_scale, "xmag");
|
ortho.setXMag(cam->ortho_scale / 2, "xmag");
|
||||||
ortho.setAspectRatio((float)(sce->r.xsch) / (float)(sce->r.ysch), false, "aspect_ratio");
|
ortho.setAspectRatio((float)(sce->r.xsch) / (float)(sce->r.ysch), false, "aspect_ratio");
|
||||||
ortho.setZFar(cam->clipend, false, "zfar");
|
ortho.setZFar(cam->clipend, false, "zfar");
|
||||||
ortho.setZNear(cam->clipsta, false, "znear");
|
ortho.setZNear(cam->clipsta, false, "znear");
|
||||||
|
@ -846,7 +846,7 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera)
|
|||||||
switch (cam->type) {
|
switch (cam->type) {
|
||||||
case CAM_ORTHO:
|
case CAM_ORTHO:
|
||||||
{
|
{
|
||||||
double ymag = camera->getYMag().getValue();
|
double ymag = 2 * camera->getYMag().getValue();
|
||||||
double aspect = camera->getAspectRatio().getValue();
|
double aspect = camera->getAspectRatio().getValue();
|
||||||
double xmag = aspect * ymag;
|
double xmag = aspect * ymag;
|
||||||
cam->ortho_scale = (float)xmag;
|
cam->ortho_scale = (float)xmag;
|
||||||
@ -873,7 +873,7 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera)
|
|||||||
{
|
{
|
||||||
switch (cam->type) {
|
switch (cam->type) {
|
||||||
case CAM_ORTHO:
|
case CAM_ORTHO:
|
||||||
cam->ortho_scale = (float)camera->getXMag().getValue();
|
cam->ortho_scale = (float)camera->getXMag().getValue() * 2;
|
||||||
break;
|
break;
|
||||||
case CAM_PERSP:
|
case CAM_PERSP:
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user