Browse Source

-fixed bug in IisuDataSource.cs (movie.playmode can only be read if source==movie)

Alexander Hendrich 11 years ago
parent
commit
d1f7824c45
3 changed files with 16 additions and 19 deletions
  1. 2 1
      bbiwarg/DataSource/IisuDataSource.cs
  2. 13 17
      bbiwarg/Test/OutputTest.cs
  3. 1 1
      bbiwarg/bbiwarg.csproj

+ 2 - 1
bbiwarg/DataSource/IisuDataSource.cs

@@ -51,7 +51,8 @@ namespace bbiwarg.DataSource
             device = handle.InitializeDevice(conf);
             
             // parameters
-            device.RegisterParameterHandle<int>("SOURCE.MOVIE.PlayMode").Value = 0; // playMode = once
+            if (moviePath.Length != 0)
+                device.RegisterParameterHandle<int>("SOURCE.MOVIE.PlayMode").Value = 0; // playMode = once
             frameRate = device.RegisterParameterHandle<float>("SOURCE.FrameRate"); 
 
             // events

+ 13 - 17
bbiwarg/Test/OutputTest.cs

@@ -25,7 +25,7 @@ namespace bbiwarg.Test
 
         public void initSource()
         {
-            source = new IIsuDataSource("..\\..\\videos\\10.skv");
+            source = new IIsuDataSource();
             source.init();
             source.start();
 
@@ -35,7 +35,7 @@ namespace bbiwarg.Test
         {
             base.OnLoad(e);
             Title = "OutputTest";
-            GL.ClearColor(Color.CornflowerBlue);
+            GL.ClearColor(Color.Black);
         }
 
         protected override void OnRenderFrame(FrameEventArgs e)
@@ -62,20 +62,16 @@ namespace bbiwarg.Test
             for (int x = 0; x < width-1; x++) {
                 for (int y = 0; y < height-1; y++)
                 {
-                    short depth00 = depthImage.getDepth(x, y);
-                    short depth01 = depthImage.getDepth(x + 1, y);
-                    short depth10 = depthImage.getDepth(x, y+1);
-                    short depth11 = depthImage.getDepth(x + 1, y+1);
-
-                    int relX0 = x - width / 2;
-                    int relY0 = y - height / 2;
-                    int relX1 = x + 1 - width / 2;
-                    int relY1 = y + 1 - width / 2;
-
-                    GL.Begin(BeginMode.Triangles);
-                    GL.Vertex3(relX0, relY0, -depth00);
-                    GL.Vertex3(relX0, relY1, -depth01);
-                    GL.Vertex3(relX1, relY0, -depth10);
+                    short depth = depthImage.getDepth(x, y);
+
+                    int relX = x - width / 2;
+                    int relY = height/2 - y;
+
+                    GL.Begin(BeginMode.Polygon);
+                    GL.Vertex3(relX-0.5f, relY+0.5f, -depth);
+                    GL.Vertex3(relX+0.5f, relY+0.5f, -depth);
+                    GL.Vertex3(relX+0.5f, relY-0.5f, -depth);
+                    GL.Vertex3(relX-0.5f, relY-0.5f, -depth);
                     GL.End();
                 }
             }
@@ -120,7 +116,7 @@ namespace bbiwarg.Test
         {
             base.OnResize(e);
             GL.Viewport(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height);
-            Matrix4 projection = Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 4, Width / (float)Height, 1.0f, 640.0f);
+            Matrix4 projection = Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 4, Width / (float)Height, 1.0f, 3000.0f);
             GL.MatrixMode(MatrixMode.Projection);
             GL.LoadMatrix(ref projection);
         }

+ 1 - 1
bbiwarg/bbiwarg.csproj

@@ -32,7 +32,7 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <PropertyGroup>
-    <StartupObject>bbiwarg.Test.TestDataSource</StartupObject>
+    <StartupObject>bbiwarg.Test.OutputTest</StartupObject>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="iisuNet, Version=3.0.0.0, Culture=neutral, processorArchitecture=x86">