Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: cjwidd on 2020-10-07, 12:01:25

Title: [RESOLVED] Camera Match - Interpolate Viewing Position
Post by: cjwidd on 2020-10-07, 12:01:25
Title: Re: Camera Match - Interpolate Viewing Position
Post by: nauticus25 on 2020-10-07, 16:33:22
Your question: Given two cameras in different XY locations along the same local Z axis, can you adjust the settings in one to match the view of the other?

Short answer: No.

Medium answer: Not really. You can adjust the field of view of one so that the edges of the view are at just about the same spot (the cones of each camera intersect the walls in the same spot), but the sizes of objects in frame and their location in relation to each other will not match. 

Longer answer: I think you might be trying to solve a different problem than the one you should be trying to solve. In your video, I didn't see the actual photo you're trying to camera match. But if your model is accurate, then your 3D camera should be exactly in the same place as the real camera when the photo was taken. Presumably, that should be inside the room. If it isn't in the same spot, you don't have an accurate camera match.

For an accurate match, you need the physical location and orientation of the camera as well as the focal length of the lens and the camera's sensor width.

(https://i.imgur.com/9kYhvb8.jpg)

You could get dial in the accuracy even more by capturing a distortion map with your specific camera to match barrel distortion with wide angle lenses (or play with the distortion amount in the Max camera), but I've found that location/orientation/focal length/sensor width get me close enough.

The other important detail with a camera match is that your backplate photo must not cropped/rotated. Render your image and composite it with the backplate first, then crop afterwards.


Title: Re: Camera Match - Interpolate Viewing Position
Post by: sprayer on 2020-10-07, 22:37:02
Agreed it's not possible, because it will change FOV.

Simple solution to hide the wall is clipping planes
https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/3DSMax-Reference/files/GUID-C2E55F9A-4F78-4D48-B5C5-1127AA5FBF2C-htm.html

And there is tools to move camera along view in bottom right corner, you do not need local moving.
https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/3DSMax/files/GUID-48D8123A-DA66-4E0E-B09B-A17D5D7A7EB4-htm.html

How you did match camera to photo?
Title: Re: Camera Match - Interpolate Viewing Position
Post by: cjwidd on 2020-10-07, 22:49:34
Yeah, without metadata from the source photo, I did a camera match based on the perspective match tool only. I think you're right though @nauticus25, the problem is unconstrained. If the XY coords weren't also changing, I think it would be possible.
Title: Re: [RESOLVED] Camera Match - Interpolate Viewing Position
Post by: mferster on 2020-10-08, 00:26:24
You are also assuming that the photo you are trying to match is in fact a full frame photo and not a photo that has been cropped and edited after the fact.

If it has has been cropped you will get different camera setting results than what you are expecting.

*edit: Also is there any particular reason why you aren't just using camera clipping if you are ultimately just trying to see through a wall?
Title: Re: [RESOLVED] Camera Match - Interpolate Viewing Position
Post by: cjwidd on 2020-10-08, 01:48:11
Yeah, the question as I outlined in the video really isn't about perspective matching, as it is about calculating lens properties to generate an identical.image for two cameras at different positions.

I talked about how I knew there were other more practical solutions - which I ended up doing - but I was just curious if it were possible.