Windows SDK v2.0.1 Released
Vuzix Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Windows SDK v2.0.1 ReleasedExpand / Collapse
Author
Message
Posted 3/24/2008 9:46:55 PM


Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Administrators
Last Login: Yesterday @ 5:21:00 PM
Posts: 37, Visits: 167
A new version of the Vuzix iWear VR920 SDK for Windows (32-bit) has been posted to the Downloads and Drivers page of the Vuzic web site's Support section.

The new version of the SDK provides a single definitive solution for adding native mode support for the Vuzix 3D Stereo Drivers.

Ron Haidenger,
Vuzix Corporation
Post #1941
Posted 3/26/2008 7:23:37 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderated Users
Last Login: 12/4/2008 1:36:50 PM
Posts: 539, Visits: 1,120
Is it just me, or is there no SDK in the SDK?

Or is it installing the SDK in some complex location other than the chosen directory?

When I install it, I can only see a folder called "driver" which contains the actual .inf and .sys files for the hardware driver. But I don't see anything that I would describe as an SDK.

Post #1954
Posted 3/26/2008 2:17:03 PM


Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Administrators
Last Login: Yesterday @ 5:21:00 PM
Posts: 37, Visits: 167
The SDK installer creates and places files in the following two directories:
C:\Program Files\Vuzix Corporation\IWEARSDK
C:\ IWEARSDK

A notation regarding this has now been added to the read me file that accompanies the SDK download.
Post #1960
Posted 3/26/2008 9:30:57 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderated Users
Last Login: 12/4/2008 1:36:50 PM
Posts: 539, Visits: 1,120
Oh, I see it now The SDK is in C:\IWEARSDK\
Thank you very much.

The way the SDK documentation and sample say to do stereo is wrong, or at least not optimal.

The way they do it, everything will pop out of the screen, and nothing will be behind the screen. That's not a huge problem when using the VR920 because the (virtual) screen is 9 feet away. So it won't look as bad as on a desktop monitor which is 60cm away. But still, if you want the sky and distant objects to have a real sense of depth, you should render part of the scene behind the screen. Also objects too far in front of the screen cause eye strain. To minimise eye strain, half (or more) of the scene should be behind the screen.

There are two stereoscopic parameters that are important. The documentation describes separation, which is the strength of the 3D effect. It is the distance between your eyes. In real life the actual distance between your eyes is 6.4 cm, but normally people use a slightly lower value for stereoscopic rendering because it is very hard for your eyes to focus on a screen 9 feet away, while they look at an object 1 foot away or 100 feet away. It is good to let the user adjust this value. Separation is achieved by moving the camera sideways.

The missing parameter is convergence, which I like to call screen depth. It determines which objects appear in front of the screen and which objects appear behind the screen. For maximum realism objects further than 9 feet away should be behind the screen, and objects closer than 9 feet away should be in front of the screen. Although some other values feel better so it is good to let the user adjust it. Convergence is achieved by using an off-axis projection matrix. You can't use a normal projection matrix. The following is the WRONG way to do it:

D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 2000.0f );
g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );

That creates a projection matrix for a (vertical) FOV of 45 degrees (pi/4), with the centre of the view drawn in the centre of the screen. The problem is that the centre of the view should NOT be in the centre of the screen. The middle of your right eye is actually looking somewhere in the right side of the screen, while the middle of your left eye is actually looking somewhere in the left side of the screen. So you need to use a different projection matrix for each eye, and you need to use an "off axis projection".

In AssaultCube, this is what I would use if I wanted to do it correctly (pardon my OpenGL). This code sets the projection matrix. I have combined the camera moving for the two eyes, and the convergence both into the projection matrix, so you can use the exact same view matrix for the two eyes (this is projection matrix abuse, but it makes our life much easier).

  /* Note that there are 3 planes... the near clipping plane, the screen plane, and the far clipping plane. The screen plane is the screen itself, which should be about 9 feet away. The near clipping plane is the plane close to the camera which prevents it from drawing anything too close to the camera. It should be about 1 or 2 feet away. The far clipping plane is the plane that prevents it from drawing anything too far away. It should be a couple of miles away. To create the off-axis projection matrix, OpenGL and Direct3D require us to specify the left, right, top, and bottom coordinates of the view as what they would be on the near clipping plane. ScreenDist and sep control the stereoscopic parameters by specifying how far away the screen is and how far apart your eyes are in game units. */

  // fovy is the vertical field of view IN RADIANS
  // zNear is the near clipping plane distance
  // ScreenDist is the distance of the screen, which should be about 9 feet
  // zFar is the far clipping plane distance
  // sep should be 6.4 cm, or a user specified interoccular distance (distance between eyes)
  // all those distances need to be converted to game units.
  float aspect = 4.0f / 3.0f; // 4:3 aspect ratio
  float HalfHeight = zNear * tan(fovy/2); 
  float zNearDividedByScreenDist = zNear / ScreenDist;
  float left, right, top, bottom;

  if (righteye) {
    left = -(aspect * HalfHeight) - 0.5 * sep * zNearDividedByScreenDist;
    right = aspect * HalfHeight - 0.5 * sep * zNearDividedByScreenDist;
  } else {
    left = -(aspect * HalfHeight) + 0.5 * sep * zNearDividedByScreenDist;
    right = aspect * HalfHeight + 0.5 * sep * zNearDividedByScreenDist;
  }
  top = HalfHeight;
  bottom = -HalfHeight;

  glFrustum(right,left,bottom,top,zNear,zFar);
  if (righteye) {
    glTranslated(-0.5*sep,0,0); // move world left, same as moving camera right
  } else {
    glTranslated(0.5*sep,0,0); // move world right, same as moving camera left
  }

The problem with doing it correctly like that, is that crosshairs don't work! To get crosshairs to work correctly, you can either move the position where the gun fires from so it fires from level with your right eye and also move the crosshair so it is not in the middle of the screen but rather is level with the middle of your right eye; OR you need to change it so that the right eye is in the middle of your head, and the left eye is 6.4 cm to the left of the middle. The second option is easier, since you don't need to change the firing code, and the crosshair is still in the middle of the screen. In both cases you should only draw the crosshair on the right eye's view. If you don't want a crosshair (there are better alternatives) you don't have to use either method. Note that the second option isn't rendering the scene strictly correctly, but I find it still looks good. Here is how I used the second option in AssaultCube:

  // fovy is the vertical field of view IN RADIANS
  // zNear is the near clipping plane distance
  // ScreenDist is the distance of the screen, which should be about 9 feet
  // zFar is the far clipping plane distance
  // sep should be 6.4 cm, or a user specified interoccular distance (distance between eyes)
  // all those distances need to be converted to game units.
  float aspect = 4.0f / 3.0f; // 4:3 aspect ratio
  float HalfHeight = zNear * tan(fovy/2); 
  float zNearDividedByScreenDist = zNear / ScreenDist;
  float left, right, top, bottom;

  if (righteye) {
    left = -(aspect * HalfHeight); // - 0.5 * sep * zNearDividedByScreenDist;
    right = aspect * HalfHeight; // - 0.5 * sep * zNearDividedByScreenDist;
  } else {
    left = -(aspect * HalfHeight) + 1.0 * sep * zNearDividedByScreenDist;
    right = aspect * HalfHeight + 1.0 * sep * zNearDividedByScreenDist;
  }
  top = HalfHeight;
  bottom = -HalfHeight;

  glFrustum(right,left,bottom,top,zNear,zFar);
  if (righteye) {
    //glTranslated(-0.5*sep,0,0); // move world left, same as moving camera right
  } else {
    glTranslated(1.0*sep,0,0); // move world right, same as moving camera left
  }

Notice how the right eye is no longer moved at all, but the left eye is moved double. This version is only for games that need a crosshair in the middle of the screen. For other games, use the original code above it.

Post #1962
Posted 3/28/2008 4:41:15 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Administrators
Last Login: 4/2/2008 1:01:05 PM
Posts: 2, Visits: 5
1. The Vuzix engineering team thanks all of the developer community for your great efforts in improving the quality of the revolutionary VR920.

2. The “VR920 (Dx9) Stereoscopic workspace” is demonstrating to our developers the “How To” in terms of interfacing to our hardware and providing a means of assured Left/Right eye frame synchronization.
- By no means is the sample/s a defacto standard on how to generate a left / right eye pair.
- Any developer who already has a rendering engine producing a left and right eye pair will only require the Frame sequencing process.
- Any developer new to the stereoscopy rendering process, please read links included below.
Depending on the developers rendering engine, there may be further modifications required for appropriate stereoscopic renderings.

3. The Vuzix engineering team will be incorporating an Opengl workspace in an upcoming VR920 SDK release.
- That will be demonstrating the opengl stereoscopy method as discussed herein. See links below.

4. Vuzix will consider any and all methods that could potentially improve upon the process as requested and or posted by any and all members of the VR920 forums and the VR920 developer community.
- Vuzix will be considering follow-on DirectX stereoscopy workspace updates to a future SDK release.

5. The below links are included for all developers seeking further reading on the subject.

Some “Dos and Don’ts” on creating 3D content: see chapter on stereoscopic development
http://developer.nvidia.com/object/gpu_programming_guide.html
Very clear explanation on the process of off axis projection, See “EXAMPLE #2” in the below dissertation:
http://local.wasp.uwa.edu.au/~pbourke/projection/stereorender/
OpenGL stereoscopic source example
http://www.orthostereo.com/geometryopengl.html
Article on Microsoft windows open GL stereoscopy:
http://www.reald-corporate.com/scientific/downloads/pcsdk.htm
Article on DirectX off axis projection:
http://www.codeguru.com/Cpp/misc/misc/math/article.php/c10123__2/#more
Further opengl sample source:
http://ironicresearch.com/stereo3d/algorithm.html
Interesting case studies on best stereoscopy settings and configurations:
http://64.233.169.104/search?q=cache:CBK84jC8PUEJ:www.cs.princeton.edu/~min/publications/min94.pdf+stereoscopy+off+axis+projection+matrix&hl=en&ct=clnk&cd=8&gl=us



~~~~~~~~~~~~
Senior Software Engineer
craig_travers@vuzix.com
Post #1965
Posted 3/28/2008 10:50:32 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderated Users
Last Login: 12/4/2008 1:36:50 PM
Posts: 539, Visits: 1,120
One other thing that might improve the process...

For some reason, trying to read the monitor name doesn't work on my laptop. I don't know if it is the nvidia driver, or vista, that is the problem. But searching for a monitor named IWR02 will not work on my laptop, and possibly not on some other computers. The monitor name also doesn't show up in display settings control panel so it is listed as generic monitor or plug and play monitor, but the name does show up in nvidia control panel.

So I have to use the alternative method of looking for a monitor whose maximum resolution is 1024x768, and whose maximum refresh rate is either 60Hz or 63Hz. You might want to consider doing that if searching by name fails.

By the way, I only posted OpenGL code because I was too lazy to convert it to Direct3D. It is intended to demonstrate the technique for creating the projection matrix, and you should be able to apply the same principle in Direct3D.

Post #1967
Posted 4/2/2008 12:57:09 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Administrators
Last Login: 4/2/2008 1:01:05 PM
Posts: 2, Visits: 5

1. Prior to the Version 2.0 "VR920 (Dx9) Stereoscopic workspace". If the VR920’s VGA Adapter was not detected, the application would inform the user and exit.

2. As of the new "VR920 (Dx9) Stereoscopic workspace" the user is provided with an option to continue using the VR920 on the default adapter.
   - The provisions provided for the user to select the VR920 adapter "When not found" are left to the developer.
   - It is highly recommended to integrate a procedure that promotes predictable results.

3. Situations when the Adapter may not be found:
   - The user’s system is running XP, and the system was booted without the VR920 plugged into an adapter.
   - Clone mode and the VR920 is not configured as the Primary display.
   - Lap Tops providing a non-standard means of configuring there VGA Adapter.
   - The EDID string is not properly read by the user’s underlying video system.

 

~~~~~~~~~~~~
Senior Software Engineer
craig_travers@vuzix.com

Post #1991
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: TechSupport, Daddo

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 10:04am

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0.047. 8 queries. Compression Enabled.