Déc 022013
 

This time, lets add a zoom and rotating effect on our camera.

And lets re use the rotated sprite class you may have seen in Article 12 – Pixel collision on rotated shapes.

The only major change in the camera is the following where we will now use the position + rotation + zoom.

viewmatrix = Matrix.CreateTranslation(New Vector3(-position, 0)) * Matrix.CreateRotationZ(_rotation) * Matrix.CreateScale(New Vector3(_zoom, _zoom, 1))

The video.

The source code.
XNA_DEMO_20.2

 Posted by at 22 h 56 min

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.