bjornblissing / osgoculusviewer

An OsgViewer with support for the Oculus Rift
Other
106 stars 67 forks source link

I fixed the view and projection matices and made some minor changes #4

Closed nicokruithof closed 11 years ago

nicokruithof commented 11 years ago

I believe that the view matrix should also have the translational offset to get the right perspective. The other two commits are just minor fixes/changes.

bjornblissing commented 11 years ago

I have merged your first three changes, but added my suggested edit to the slave camera set up instead.

nicokruithof commented 11 years ago

If I open axis.osgt, and look right at one of the axis, I expect to see it from the right side with my right eye and from the left side with my left eye. With your patch it looks like the projection is parallel (the axis points right into both eyes). See also the two sceenshots.

I do agree that we should query the view matrix, but the construction might still be a bit off.

untitled window_008 untitled window_009

bjornblissing commented 11 years ago

The projection in the Rift should be parallel according to the documentation. But as you point out the translation between the left- and right eye images are not correct. I found a bug in the viewMatrix calculation. The half IPD was erroneously multiplied with the viewCenter, which made the translation close to zero.

I have fixed this bug in following commit: e8f5cff80037a7c22e016a32806d58c00fd86c17

So now the translation of the eyes should be correct.

nicokruithof commented 11 years ago

Yes, I can see stereo as well. But there still seems to be something off with the scaling. The z-axis looks wider than the x-axis and the cow seems fat.

Any clue?

bjornblissing commented 11 years ago

Have you pulled the latest changes that were submitted yesterday? I fixed an aspect ratio related bug, which could have been the cause of the "fat cow". 6a265959f85ca16d097faf8c4e1f587c90d32219

nicokruithof commented 11 years ago

Thanks. Missed that commit. Now it looks fine.

Nico