-
Notifications
You must be signed in to change notification settings - Fork 191
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
Render Camera from projector view for Projection Mapping #56
Comments
Do you still have MainCamera somewhere in the scene? It might be a leftover and should be removed as it will likely render on top of the projector. If not... please provide a bit more details about your scene (images of your scene graph as well as User Views inspectors would be helpful). Have you completed both Tutorial 1 and 2? |
Thanks for the quick response. I'm using Unity 5.6.0f3 I've followed both tutorial 1 and 2 and I've made sure the main camera is deleted from my scene. Everything Appears functional, I can see where my projector and kinect are in the scene and they line up accurately to there real world position. I've got the layers setup like your tutorial but when I press play it always defaults to what seems like the view from the kinect camera. |
Whats weird is even the example scenes default to kinect view. Is there an option I need to change in one of the scripts to default to the projector view instead? Maybe its a unity 5.6 specific issue but Im not getting any errors so thats probably unlikely. Thanks in advance for your help |
Right now it seems that your user is not actually tracked from Kinect or any other camera (i.e., there is no specified RAT Skeleton Provider linked in RATUser script). This means that the User will have the exact same view as your Kinect camera (since both of those are set at the origin). If you position the user somewhere else (e.g., by dragging that object around), then their views should be different from Kinect. This still does not explain why the projected view in Game window is the same as Kinect, which is what I believe you are experiencing, correct? Could you share a side-by-side view of your Scene and Game windows? |
Your projector and Kinect are not all that far apart (~0.5m)... so if you are looking at far-away surface and your user's view is in the same location as your Kinect, I don't suspect that there will many significant distortions in the projector image that you can observe. Moving the User's position, should drastically affect the rendered image though. |
Thanks for the response, if I understand correctly it sounds like if I just move the user to the location of the projector manually (stupid me for not trying this) it will line up? Will it preserve all the FOV and camera intrinsics ? My main use at the moment is to test some projection mapping on 3d objects so getting the precise view from the projector is important. |
I would not move the projector. If you did the calibration step correctly, the pose of the projector should be correct. |
Sorry my wording was poor I meant move the user. Sounds like that should help I will keep you posted thanks again for the help |
Ok... let me know how it goes. |
I'm interested in the same thing and am experiencing the same issue... whenever I play the application in Unity it renders from the kinect perspective. For my purposes I only want projection mapping; view dependent projection is great too but not a feature I want to activate currently. Even so, I have followed tutorials 1 & 2 and cannot seem to get the view dependent projection to work. The kinectserver.exe is running with skeletal tracking and I can see the depth stream in unity. I have added a user object and assigned all game objects to the layers described but I can't seem to change the camera view away from the kinect. My preference would be to only render the projection view. Thanks for any suggestions you might have and for making a very powerful toolkit! Running Unity 5.6.0f3 |
@reillydonovan were you ever able to resolve? |
I believe I am seeing the same behavior on Unity 5.6. Has either one of you tried this in Unity 5.5? It seems that Unity 5.6 has changed how camera rendering is ordered which will likely impact how projection mapping is performed. I need to investigate this further, but in the meantime, I'd recommend trying it out on Unity 5.5 which is the latest version where the code was tested. https://unity3d.com/unity/whats-new/unity-5.6.0 |
Since upgrading to Unity 5.6 it seems that the camera rendering order is broken. I have cameras with depth -100 rendering on top of cameras with depth 1. I'm working on a fix, but it won't be posted until next week. In the meantime, I'd recommend using 5.5. Others have also noticed this: |
Ah makes sense, I had a feeling it could be cuz of unity version. Thanks for the update I will switch to 5.5 thanks! |
Thanks benko! Checking 5.5 now... rolling back to 5.5 works and corrects the render order for the cameras |
@reillydonovan Glad to hear its working but Im getting some even weirder results. No matter what version of 5.5 I am getting just a black screen even on the example scenes (I can see the green virtual screen in TestRATScene1x1) but Im not seeing the room geometry. Whats weird is I go to version 5.6 and I can see the room geometry but I have the render order issue. Curious if you have 5.6 and 5.5 both installed or what was your process on getting success. |
Do you have any items flagged as a virtual texture? If you put your kinect scan onto the virtual texture layer you should be able to see it projected back onto the scanned surface. |
Folks, I've just pushed new updates for Unity 5.6 which incorporate the fix for messed up camera z-ordering. I've explained more in the markdown (see FAQ) for the project. Until I find a more permanent fix, this will have to do. Please try it out and report back if you have more issues. |
Maybe Im missing something stupid, I've got everything setup like the tutorial for unity and working. But for some reason when I press play its always locked to the camera perspective from the Kinect. In my case Im trying to do projection mapping so I want to render the camera from the view of the projector. I read in your doc that it defaults to kinect view when no user is detected but is there a way to easily change to the projector view camera.
Thanks
The text was updated successfully, but these errors were encountered: