ofxCameraSaveLoad icon indicating copy to clipboard operation
ofxCameraSaveLoad copied to clipboard

Camera Save/Load retaining orientation but not the XYZ position

Open mgs opened this issue 4 years ago • 5 comments

Hi Roy!

I'm having an issue with reloading the camera position in v0.11 (only tested from windows so far).

To reproduce:

  1. Move the camera into a new orientation and then, by holding 'm', click and drag the camera to a new position.
  2. Save the camera using ofxCameraSave.
  3. Double click to reset the camera.
  4. Reload using ofxCameraLoad.

Result: Camera orientation reloads but the position seems to jump back to the original reset position, but with the correctly saved orientation.

I tried: Unfortunately, cam.setAutoDistance(false) didn't resolve this.

mgs avatar Apr 28 '20 15:04 mgs

Following up, I found that this commit which seems related to the same problem is actually causing the problem on Windows. Commenting out the line added here makes it work perfectly!

Here's the related commit: https://github.com/roymacdonald/ofxCameraSaveLoad/commit/cc83cac3273757ba04de654587b0ebf4013f2845

I can test this week on linux and mac and if it's just a matter of some #ifdef I'll send you a PR.

Thanks for making this one, Roy. It's a very nice and handy addon! :)

mgs avatar Apr 29 '20 05:04 mgs

Confirming on mac that this line cam.setDistance(cam.getDistance()); (linked to above) is also a problem on mac using 0.11. It seems to malfunction most often when drag is used before saving. Here are some camera values edge cases that trigger the mismatch of loaded camera positions for me.

edgeCases.zip

Once I comment out cam.setDistance(cam.getDistance()); it seems to work as expected.

Thanks for the addon Roy! I use it often.

crecord avatar Nov 21 '20 00:11 crecord

Hi @crecord Thanks for letting me know. Glad to know this addon is useful to you. That line was added to fix another issue related to dragging. I am using OF's current github master branch and I also see some other odd behaviors. I'll take a look and let you know.

roymacdonald avatar Nov 21 '20 03:11 roymacdonald

Hi @crecord, I checked and I can no longer reproduce the problems commit that https://github.com/roymacdonald/ofxCameraSaveLoad /commit/cc83cac3273757ba04de654587b0ebf4013f2845 was supposed to fix.

Anyways, I think it is much worse not being able to load the camera at the correct position than having trouble with the mouse buttons.

I just have pushed a commit commenting out the offending line.

All the best

roymacdonald avatar Nov 22 '20 04:11 roymacdonald

Thanks for looking into it @roymacdonald .

crecord avatar Nov 23 '20 17:11 crecord