I have a camera pointed straight at the xz plane. I am trying to make it so I can predict the exact pixel measurements at that plane. Is there a mathematical formula for calculating all the camera settings to achieve this? I suspect it would be a bit complicated, involving the camera distance, angle of view, zoom, aspect ratio, etc.
why don’t you use image planes?
Thanks as always, Joojaa, for your interest and help.
I’ve been working on a simple 3d keyboard for a website. With pixel exact measurments, I would be able to have extremely simple CSS (cascading style sheets) to design the layout of the site. In addition, I would be able to overlay the computer keys (which are interactive buttons) on top of another image rendered in Maya. I’m exporting to psd layered files. Because of web issues, the keys are split up into separate images. (So I don’t use an image plane.) I would like to overlay the images on top of another Maya rendered image, but because I don’t have pixel exact measurements, it will never align easily.
It’s possible to place every computer key with CSS by eyeballing it and specifying the position for every image. But if I had pixel exact measurement, the CSS would be much simpler, I could automate it in one step. (For instance any changes I make in the future, I would have to change the CSS for every key.) This isn’t necessary. It would just be nice. For the kinds of simple 3d rendering that I can see myself doing in the future, this is something that I think I would use often.
Again it’s not necessary, but there has to be a way, right? I doubt I’m the first person that wanted pixel exact results. Does anyone have any links/suggestions?
Urrgh, you do know that pixel exact on webpage is a VERY bad idea since the web and css as a medium sint really pixel perfect.
There are differences between the browsers, but I don’t have a problem with CSS. You can specify exact pixels in CSS by using absolute positioning. Can you do this in Maya?
Oh godam you still haven’t got the keyboard issue sorted…
Well yes and no. pixel dimensions have only any meaning form the cameras point of view. Worse if you were to do anything 3 dimensional, each subsequent height value would need to react differently to this value. Now then you have no idea of your subpixel accuracy either so the aa might throw this off by a sub pixel.
So you can do pixel nudges by alt arrow but you wont get right pixel moves except under very weird conditions, such as orthographic views.
Anyway image planes are exactly what your looking for here.
QUOTE
I would like to overlay the images on top of another Maya rendered image, but because I don’t have pixel exact measurements, it will never align easily.
Umm if they are both maya rendered images you can allign them easily. Align them in 3d and then layer them.
PS well ive done web pages since conception of html about 6 days after release of mosaic, and while people actually seem to want pixel perfect medium, they wont get it. There are several reasons most prominent being A. Its my browser and i do what the hell i like with it, some programs like grease monkey testify this very well B. You have absolutely no control over the medium with which i browse, so for example if i compare as a medium my, 37 inch HDTV, any of my my 24 inch monitors, the 17 inch laptop monitor and the 2,5 inch mobile phone. Pixel perfect looses its entire power here since if i look at the average pixel perfect page on my 24 inc high res monitors everything is very small. whereas everything in general is huge in my cellphone.
HTML hasn’t really changed its purpose over the years although the next gen has always tried to say its so. Web is still not a what you see is what you get medium. In fact thats not desirable either the further we go on the closer html is to what it was first designed for, css on the other hand is another matter, but unfortunately css has some legacy badness in it.
Ok do this:
switch to your top view,Click on view -select camera form the viewport, hit ctrl-a for the attribute editor. find the ortographic section type the width of your one image (if you plan to slice it don’t do one at a time), put some slack (laokc this views transforms in the channel box). Create a cube split into 4 segments move the extra ones close to the corners. Laticce them with a 2 2 2 latices grow latices bottom to X uniyts wide (where each unit will be a pixel),and y units high make same but a bit smaller for the top. Smooth latices with 3 3 3 move the center down a bit then move the top center row down a bit.
now you have one key duplicate it move to the side, the other copy the row move up adnd bit side repeat on bottom. Assign primary visibility off for all other than the center button.
Set render resolution to width height you sued previously. Light, and color don’t texture… make a render layer for occlusion. Them make all the other layers you need. Render all alyers for top view. Bring into photoshop multiply the color channels by your key texture you paint in photo shop. layer all all keys done.