SlideServe
Menu
Préférences
© SlideServe · v2026

Introduction to 2D Drawing Basics in XNA for CSE 3902

saniya avatar
9 diapositives · 254 Views · Oct 22, 2014

This overview discusses the fundamentals of 2D drawing in XNA, focusing on coordinate systems and raster images. It covers essential components like the origin and 2-tuple positioning relative to the origin. The guide illustrates different 2D coordinate systems, including Cartesian and Polar coordinates, and elaborates on raster image types such as PPM, GIF, JPEG, and PNG. Additionally, it explains the SpriteBatch class in XNA, highlighting methods for sprite drawing, including Begin, Draw, and End, as well as how to utilize the Texture2D class for rendering graphics.

Introduction to 2D Drawing Basics in XNA for CSE 3902 - slide 1
01 / 9Introduction to 2D Drawing Basics in XNA for CSE 3902
1 / 17

Télécharger la présentation

Introduction to 2D Drawing Basics in XNA for CSE 3902
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. 2D drawing basics For CSE 3902 By: Matt Boggus

  2. Overview • 2D coordinate systems • Raster images • Sprite drawing in XNA

  3. Coordinate system • A coordinate system is a system which uses one or more numbers, or coordinates, to uniquely determine the position of a point • For a 2D coordinate system, we need • Origin • 2-Tuple of position relative to the origin

  4. 2D coordinate system examples Cartesian Coordinates (http://en.wikipedia.org/wiki/File:Cartesian-coordinate-system.svg) Polar Coordinates (http://en.wikipedia.org/wiki/File:CircularCoordinates.svg)

  5. XNA’s coordinate system

  6. Raster images http://en.wikipedia.org/wiki/File:Rgb-raster-image.svg

  7. Raster image types • PPM • Uncompressed, human readable • GIF • 8 bits per pixel per channel (RGB) • JPEG • Lossy data compression • PNG • Lossless data compression

  8. Sprite drawing in XNA • SpriteBatch object • Begin (call once to start specifying sprites to draw) • Draw (each call specifies another sprite to draw) • End (call once to finish specifying sprites to draw)

  9. SpriteBatch Draw methods Example Image File / Texture2D public void Draw ( Texture2D texture, Rectangle destinationRectangle, Color color ) public void Draw ( Texture2D texture, Rectangle destinationRectangle, Nullable<Rectangle> sourceRectangle, Color color ) Drawing window XNA rectangle object