we need to find a way to accurately render oversize renders out of cinema4d. For example our base render is 2048 x 1024, but i need to render an extra 100 pixels on each side to allow for camera shake. So the total size needs to be 2248 x 1224. However you also need to adjust the field of view otherwise it doesn’t include the extra edges.
Am trying to set up an xpresso preset to do this, but don’t really know enough about the maths behind camera’s to work it out. Anyone done this before or know what the formula might be?
I found this thread which explains it better than i have, but unfortunately its old and the download link is gone
The problem with exact the same padding top/bottom and left/right is, that you get out of your aspect ratio.
The question is, do you like to have it simple and stay in the aspect ratio, or is the 100+ a must have for all sides.
2:1 before and 1.836601719:1 with padding. Just a thought, both are possible, and it is not more work ;o)
======
It is normally done with a second camera. This camera is connected via a Global Matrix to get the position and rotation in sync.
The field of view is then calculated by the half field of view, to get a triangle with a 90º in it, this helps to get from the original render size the new one.
Sometimes people connect all other parts in the camera as well, to be able to switch between the two comfortably.
So if you like the 1.8366’ ratio, you need to do that for the horizontal and the vertical FOV. (tan alpha=opposite/adjacent) this formula works for the “Half FOV” as base. First you get the Half FOV from the given size, and then you get the Half FOV for the padded size.
You work then of course with two render settings, which are switched in sync with the used camera.
All the best
Sassi
P.S. why not shake the camera in C4D directly. ;o)
Thanks Dr sassi, its starting to make a bit more sense now. I could animate the camera shake in c4d but would like to figure this out once and for all as its good for adding lens distortion back on too.
So adjacent in this case would be the focal length in mm and opposite would be half the image size (although this is in pixels so i guess you need to convert that to mm too?). Is that correct?
Yes it is good to have this, as it is something that “one” need to compensate for Lens distortion adjustment, while compositing CG to practical. I always wonder how people can work with out that, e.g., when they camera track something (more about that soon in my Integration series)
No mm, as this would make things more complicated, just the field of view and then the Opposite is the Pixel/2, the camera axis is in both cases the adjacent (as it will be the same value, you solve both to that value and go from there)... well, I will put that in a formula, give me a “minute”, but please test this carefully as it is late here already. OK?
This should work:
(atan((tan($1/2))*(($3+$2+$2)/$3)))*2
$1 is the current “Field of View”
$2 is the pad size
$3 is the original “Horizontal Pixel Width”
You need to switch the camera as well the render setting always at the same time. Please test this carefully before you start long renderings. It’s 11:20pm here…
Click on the XPResso Tag to get to the Attribute Manager Interface.
By the way, not sure if this is a bug with xpresso or something i’m doing wrong. But if i copy and paste your camera and the xpresso tag into another scene and then drag my shot camera into the camera_original link field (on the xpresso tag) then the camera doesn’t connect. Looking in the xpresso window, its seems that the object node that this is passed onto is still blank. Only when i drag the camera into the reference field in the object node does it finally work.
You’re welcome. Yes, it should be part of the application, as it seems so useful. Don’t worry, I have had quite some education, and the amount of teachers who tried to get the trigonometry explained and the ones that had success with it ... is a long story. In short, if a teacher has a misunderstood in it, the explanation that s/he delivers will be as complicated as possible. It is rather simple, if explained logically.
Maybe I have to do a series one day, “Math for 3D Artists”, as math sets you free and allows you to grow faster in that business. Nope, no exception :o)
(At least in my experience, and I started introducing people to 3D long ago…)
I hope it works for you, please check it carefully, place both images on top of each other and set the top one to difference, if that turns not black, let me know.
The maths for 3d would be a great idea, especially when dealing with xpresso / python. I’ve got a bit more work to do on the shot first but will check the oversize to see if it matches and let you know, thanks : )
By the way, not sure if this is a bug with xpresso or something i’m doing wrong. But if i copy and paste your camera and the xpresso tag into another scene and then drag my shot camera into the camera_original link field (on the xpresso tag) then the camera doesn’t connect. Looking in the xpresso window, its seems that the object node that this is passed onto is still blank. Only when i drag the camera into the reference field in the object node does it finally work.
Not sure if its a refresh issue.
This camera set up is great tho, thanks again : )
Hey Rich,
I will try this again, as I did last night, but I copied both cameras and replaced it then.
Talk to you soon.
Sassi
I checked it, yes it loses it connection. So do this: drag the new camera onto the Node itself, and everything should be fine. After that you should be able to swap out the camera with other cameras as well.
ah i see, is that a bug in xpresso then or unavoidable? Its pretty useful to be able to pass an object to a node via a link. Not that its a hard workaround : )
I wouldn’t call it a bug, but yes it looks like on. Let me explain: The Node is based on a camera that I dragged earlier into the XPresso Editor. The Node is kind of a container, as it is not the object itself, it is like a wrapper to get in contact with the object (Roughly said, and simplified.) In the moment it becomes copied to a new scene without that camera, the container is empty and has no idea what to do next.
I don’t know what other do, for my own scenes, I attach a child object (in this case a camera) underneath and have that as Container-supply so to say. Works for me, but it would show up in the camera selector menu and can cause trouble if selected accidently. In that way I do not pack it into the file at all—for others. You could do that, name it “never touch it.camera” and you’re fine.
So, having said that, lets call it for a moment a bug, just for fun. WE could expect that it has no amnesia when the object becomes disconnect, so it remembers all the stuff that happened before, right? Would be cool if. BUT: it would not show up that an object is missing until you really need it. Maybe way too late perhaps. So the clever developer have decided to show only facts, not a romantic history, hehe. Call it a limitation and you might have it covered without arguing with the creators. ;o) Anyway, you’re right, it could be simpler, keeping its memory, but turning completely red or so in case of object-loss. Fell free to suggest that to MAXON if you like.
Yup i understand, i just found it confusing as there was no warning that the camera node had lost its connection other than the fact that it wasn’t moving with the main camera. All good tho.
I finally did the test as well, rendered out the two sizes cropped the larger one down to the smaller size and it works great! Thanks again
would you mind if i put this file on my blog? I’d give you full credit for it (in which case i could link to your website or this thread?). Would be useful to have it someplace where it could be found again in the future.
Please use it of course, as long as you describe it as little solution “put together for your current needs” ;o) I think it could have had some more love (adding a hidden camera as mentioned above). But for a short “help you out” solution it is (hopefully :o) just fine. You can just link back to Cineversity if you like, I like credits, but only if you feel it fits into your writing of course, don’t worry too much about. I wouldn’t be upset if you mention just Cineversity.
For the future - I have to think about a Math/C4D fusion series, so people can put those stuff together on the fly, where ever they are. That would be my ideal situation for everyone. :o)
Thanks for asking, that is very nice of you!
Have a great Sunday.
Sassi
P.S.: for everyone looking for his blog, just google “rich nosworthy’s Blogs”