algorithmic modeling for Rhino
Hi all,
Image we have a projector and an arbitrary plane oriented in 3d space. Finding the projected boundary of the screen on this plane is simple - you just intersect each corner ray with the plane. The result is a planar quad.
Now what I want to do is just the opposite:
Knowing the input data:
- location of quad (ABCD)
- original screen proportions (ratio A'D' : A'B')
how do I find the location of the projector (O) and it's orientation plane?
I'm thinking this can be done either algebraically (finding transformation matrix using know coordinates, example) or geometrically, unfortunatelly i'm stuck in both approaches.
Any ideas? Thanks in advance for any clues!
JJ
Tags:
Four planar points are not enough information to find the origin of the projection.
Even if you are able to figure out the projection axis (center of projection to center of original) and the planes rotation against each other, you still don't know the projectors distance. You'd need additional info such as: original screens true size, distance screen to projection plan or projector field of view.
Thanks Hannes, I guess you're right. Ok, assuming we know this additional info, ie. field of view - how would you go about finding the solution?
Ok, I've managed to get a working geometric solution, here's the pseudo-proof:
1. The centerline of projection OX' is colinear with OX, where X is the intersection of the quads diagonals
2. Let's examine triangle AOC: OX bisects angle AOC.
3. Since we know the angle AOC (equal to A'O'C, which we can derive from the projector's known settings) we can also construct point O" (by intersecting two arches on any plane).
4. If we revolve this point (O") around segment AC we get a collection of possible locations of O
5. Repeat steps 2-4 for the other triangle (BOD) and we get the second possible set of locations (a circle revolving around DB
6. Intersect the two circles and we get O
I tested this and it works. However I'm still looking for a more elegant, solution. The best thing would be to do it all in a scripting component.
Two thougths:
1) If you know the exact 3D position of ABCD and A'B'C'D', you get O by picking any pair of mathematical lines AA', BB', CC' and DD' and find their intersection.
2) If you know the exact 3D positions of ABCD you need the exact dimension of XX' and A'B'C'D' because the OX depends on both the scale of and distance to A'B'C'D'.
Try to scale A'B'C'D' relative to X' or move along XX'. Angle A'OC' and AOC respectively will change.
If you assume A'B'C'D' to be the viewing frame of a camera, XX' will be normal to the frame and you can derive the angle AOC from the FoV settings of the camera. If A'B'C'D' is a rectangle in space projected to a screen, then angle AOC is totally arbitrary.
First of all thanks for your feedback, I really appreciate it!
I have also some new thoughts on the subject. First let's take a step back and try to define the exact question again, as I might have been not precise enough earlier.
To put it as simply as possible - it all comes down to a real life situation:
Now, my investigations had led me to the following hypotheses:
If we assume that the image is projected centrally from the projector then:
H1. there exists only one point where the projector can be located
H2. the given quad designates uniquely the source image aspect ratio
H3. if we additionally assume, that the image uses the maximum boundary (FoV) of the projector, then this FoV value is also designated unambiguously by the quad
Sorry for the convoluted description, I think the attached definition might be useful to understand what I'm trying describe.
So I assume that this problem is not possible to solve, cause you just cant manipulate the projected points like that. Proof : try to get square image projected with 10:16 projector proportion. So there are only few shapes that could be obtained with 10:16 projector.
Here is def, which enables to "design" desired projected shape.
This is true, but in a real life situation you can of course afford to not use the entire projector display and leave some parts blacked out.
Having said that, the most straightforward thing would be to just do this:
Instead, I was looking for a way to do this:
And the deifiniton I posted above can be used for that.
Now when we compare these two extreme cases we see that while B will use more of the projector's display, A will be less blurry, as the whole image is in the projector's focus range.
Having that in mind I'd say that being able move smoothly between A & B could be handy. You could specify how much coverage and focus you can sacrifice (proportionally) and the result would be a happy medium.
However, at this point I'm wondering if this isn't just an academic discussion ;-)
Any solution for this? I just encountered the same problem.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by