New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unity3D plugin #18
Comments
Yes, but I can't say when. You might be interested in the 'desktopDuplication' option in the projection mapping sample (it is described briefly in the README). It's a quick way to get the projection mapping sample to work with any program that renders to the screen. The support for it in the sample code is a bit sketchy-- some things are hard coded, but depending on your needs, it may be a very nice solution. Also note that in CalibrateEnsemble you can save the calibrated room geometry to an .OBJ file that is easily imported to programs like Unity. |
Hi, |
Yes. One thing you have to deal with is the handedness of the coordinate systems. RoomAliive Toolkit uses a right handed coordinate system (like Kinect), while Unity uses a left handed coordinate system. |
Thanks, |
Look at how GraphicsTransforms.ProjectionMatrixFromCameraMatrix is called in CalibrateEnsemble.or the sample. You can create a projection matrix for the Kinect depth or color camera in the same way that the sample creates a projection matrix for the projector. You'll need a view matrix for the color or depth camera as well. You can see how this is done in the sample for the projector; in you need the view matrix that takes a point in the world coordinate frame into the camera you are interested in. |
Has anybody integrated with Unity successfully? |
Hi Guys I am having trouble getting the projection matrix correct in unity3d. I tried to use the same method that GraphicsTransforms.ProjectionMatrixFromCameraMatrix uses. However GraphicsTransforms.ProjectionMatrixFromCameraMatrix calculates matrix that projects to a volume where x,y in [-1,1] and in z[0,1] Is that because SharpDX assumes that the viewport clipping volume ranges from -1.0 to 1.0 in X, and from 1.0 to -1.0 in Y? Unity3D assumes that the viewport clipping volume ranges from 0 to 1 for both X and Y (x right, y up) so how do I calculate the projection matrix so that it projects to a volume where x,y in [0,1]? Thanks |
I finally was able to get the projection matrix correct in unity3d :) So I would like to correct my previous post and provide a code snippet to how you can calculate the projection matrix for Unity3D 👍 So one thing I learned (please correct if I am wrong) is that Canonical View Volume and ViewPort are two different things: Canonical View Volume is 3d Box where the projection matrix projects into, and ViewPort is 2d rectangle that takes the X,Y values of Canonical View Volume and normalize them to some defined range which is (0,1) for both X and Y (X is right, Y is up) in Unity3D. So projection matrix has nothing to do with ViewPort. The reason that GraphicsTransforms.ProjectionMatrixFromCameraMatrix didn't work out of the box is that RoomAlive uses RH coordinate system as @thundercarrot mentioned, and Unity3D uses LH coordinate system, so we need to tweak the matrix to match the correct coordinate system. Here is what I did
Now my projectors see what they project :) Thanks |
Great to hear that @zaherj , |
Since we have now released a full Unity codebase, this issue is closed. |
Hi,
Do you have plan to release a plugin for Unity3D?
The text was updated successfully, but these errors were encountered: