Show
Ignore:
Timestamp:
07/03/08 18:39:10 (5 months ago)
Author:
phill
Message:

o Added camera-follows-tag feature.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/x42view.net/Gui/ModelWindow.Preview.Shaded.cs

    r492 r594  
    318318                        shadedEffect.SetValue( ehAmbient, new Vector4( amb.X, amb.Y, amb.Z, 1 ) ); 
    319319 
    320                         Matrix mat = Matrix.Invert( cam.ViewMatrix ); 
     320                        Matrix view, projection; 
     321                        GetCameraMatrices( out view, out projection ); 
     322 
     323                        Matrix mat = Matrix.Invert( view ); 
    321324 
    322325                        //key light 
     
    366369                        dev.RenderState.FillMode = pnPreviewOpts.FillMode; 
    367370 
    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 ) ); 
    371378 
    372379                        SetupLightingRig();