obtaining 2D image coordinates

Hi All,
I’m about to set off and work through some code, but thought I’d check in here to see if anyone’s already done this…or if there’s a particularly easy way to go about it…

I am exporting an animation into individual images, and need to know where in the 2D stills a given object is (in image coordinates (x,y)). I’m doing this so that I can do some random image modifications in matlab…and use my renders for psychophysical experiments.

So, for this image:
http://www-psych.stanford.edu/~remus/ex.jpg

I would like to find the coordinates of all the pieces - without coding them by hand…as it is, all 7 segments are seperate meshes.

Given the camera throw, distance, and orientation, object bounding box dimensions, etc. It should just be simple trig to figure out where an object center is located in a 2D projection of the scene.

Has anyone attempted this already?

Thanks,
-schUsseln

I think easiest way to find screen space location of 3d object - it is passing trough matrixes. Use cgkit for this.
I plan to write same script soon.

thanks…

I actually just lazied out, and decided to do it external to blender…

I just colored the objects, got rid of shadows, and re-rendered…now I have some masks, that look like this:
http://www-psych.stanford.edu/~remus/ex2.jpg
for which it’s trivial to pick out the coordinates in matlab.

good luck on your script! I’d give you mine, if I actually ended up writing it :slight_smile:

I’m just misunderstood you ( Oh my English :(( ). I thought you need to get object origin on screen space.
For me getting screen’s origin will be really usefull because I love post production. If I know coordinates on screen I can ease put some hallows, glows, 2d explosions or some other VFXs to sequence.

First problem:
In blender camera’s FOV stores in camera’s focal length. But in cgkit I need FOV in degrees around camera’s Y-axis.
How to convert lens valve to fov?

that’s the exact question I was pondering when I realized that cheating was okay for my purposes… :wink:

hopefully someone out there will have some insight to help you out. Once you’re done, I’m sure we’d all benefit from hearing what you’ve learned.

best of luck!

try this site:
http://www.alienhelpdesk.com/index.php?id=25

that’s AWESOME! Thanks!