in

This site is all about the amazingly cool stuff you can do with VB.NET.

The VB.NET XNA Project

2D Collision Sample #3 (Transformed) posted

Sample code for part three in the Collision Series (Transformed Collisions) has been posted here. Original tutorial posted at http://creators.xna.com

Collision Series 3: 2D Collision with Transformed Objects

This article explains how to perform per-pixel collision detection on sprites by using linear transformations such as rotation or scale.

Introduction

In the previous sample, you enhanced your simple obstacle avoidance game by adding per-pixel collisions, which are more accurate than the previously existing bounding rectangle test. The per-pixel technique presented in tutorial 2 accommodates only positioned sprites, without any other transformations. For many games, this is completely sufficient. However, if your game requires objects that are rotated, scaled, or otherwise linearly transformed, you are going to need a more sophisticated per-pixel collision test.

Comments

No Comments

About admin

Chris Williams is a Technology Evangelist for Magenic. He is the founder of several .NET User Groups on the east coast, and most recently the Twin Cities XNA User Group (www.twincitiesxnausergroup.com) in Minneapolis, MN. He is a VB.NET MVP, rabid blogger and owner of www.ILoveVB.NET. He's also a MCT, MCSD (.NET) Early Adopter, MCAD, freelance game developer, occasional author, tech editor, code camp & user group speaker, vintage arcade game collector and plays a pretty mean guitar in Rock Band.
Copyright 2008 - ILoveVB.NET
Powered by Community Server (Commercial Edition), by Telligent Systems