This should be pretty simple but I must be missing the point.
I'm just starting out in WPF, but as I understand it a sensible way to create a 3D scene in WPF (and other platforms for that matter) is to create a number of models all of which are centred on the origin (0,0,0). Then, to make them move around the scene, instead of manipulating each model's Position property directly you can just modify each model's transform, applying scaling, rotation and translation, and then they will appear somewhere else.
I also believe that you can treat a camera just like a model. So if you position you camera at (0,0,0) and then modify its transform then the camera should move. However, this does not appear to work. Whatever I do to the camera's transform it doesn't seem to move at all. I still observe the scene from the same point. Only when I deliberately write to the Position property does anything change and I thought moving the camera by using a transform was the preferred way of doing it. What is it that I have failed to understand?
For example, if I create a camera like this:
Camera = new PerspectiveCamera( new Point3D( 0, 0, 0 ), new Vector3D( -1, -1, -1 ), new Vector3D( 0, 1, 0 ), 5 );
and then modify it's transform as follows:
// Store several transformation in a group. Transform3DGroup group = new Transform3DGroup(); // Transform starts by rotating around the Y axis. group.Children.Add( new RotateTransform3D( new AxisAngleRotation3D( new Vector3D( 0, 1, 0 ), Angle ) ) ); // Then a translation is added. group.Children.Add( new TranslateTransform3D( Radius, Height, 0 ) ); // Assign the result to the camera's transform. Camera.Transform = group; // Now look at the LookPoint. Point3D transPos; if( group.TryTransform( Camera.Position, out transPos ) ) { Camera.LookDirection = new Vector3D( LookPoint.X - transPos.X, LookPoint.Y - transPos.Y, LookPoint.Z - transPos.Z ); }
Then I still see the scene from the point of view of (0,0,0) even when Radius is set to 100, Height is set to 10 and Angle is set to 0 and LookPoint is (0,0,0). How come?