Changeset 594 for trunk/x42view.net/Gui/ModelWindow.Preview.Shaded.cs
- Timestamp:
- 07/03/08 18:39:10 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/x42view.net/Gui/ModelWindow.Preview.Shaded.cs
r492 r594 318 318 shadedEffect.SetValue( ehAmbient, new Vector4( amb.X, amb.Y, amb.Z, 1 ) ); 319 319 320 Matrix mat = Matrix.Invert( cam.ViewMatrix ); 320 Matrix view, projection; 321 GetCameraMatrices( out view, out projection ); 322 323 Matrix mat = Matrix.Invert( view ); 321 324 322 325 //key light … … 366 369 dev.RenderState.FillMode = pnPreviewOpts.FillMode; 367 370 368 shadedEffect.SetValue( ehMv, cam.ViewMatrix ); 369 shadedEffect.SetValue( ehMvp, cam.ViewMatrix * cam.ProjectionMatrix ); 370 shadedEffect.SetValue( ehCamPos, new Vector4( cam.Position.X, cam.Position.Y, cam.Position.Z, 1 ) ); 371 Matrix view, viewInv, projection; 372 GetCameraMatrices( out view, out projection ); 373 viewInv = Matrix.Invert( view ); 374 375 shadedEffect.SetValue( ehMv, view ); 376 shadedEffect.SetValue( ehMvp, view * projection ); 377 shadedEffect.SetValue( ehCamPos, new Vector4( viewInv.M41, viewInv.M42, viewInv.M43, 1 ) ); 371 378 372 379 SetupLightingRig();
