<<PREVIOUS | TABLE OF CONTENTS | CONTINUE >> RAY-CASTING STEP 5: DRAWING WALLS In the previous steps, 320 rays are casts, when each ray hits a wall, the distance to that wall is computed. Knowing the distance, the wall slice can then be projected onto the projection plane. To do this, the height of the projected […]

<<PREVIOUS | TABLE OF CONTENTS | CONTINUE >> RAY-CASTING STEP 4: FINDING DISTANCE TO WALLS There are several ways to find the distance from the viewpoint (player) to the wall slice. They are illustrated below.   Figure 17: Finding distance to a wall slice.   The sine or cosine functions are cheaper to implement because they […]

<<PREVIOUS | TABLE OF CONTENTS | CONTINUE >> To find walls, we need to check any grid intersection points that are encountered by the ray; and see if there is a wall on the grid or not. The best way is to check for horizontal and vertical intersections separately. When there is a wall on either […]

<<PREVIOUS | TABLE OF CONTENTS | CONTINUE >> RAY-CASTING STEP 3: FINDING WALLS Notice from the previous image (Figure 11), that the wall can be viewed as collection of 320 vertical lines (or 320 wall slices). Figure 12 This is precisely a form of geometrical constraints that will be suitable for ray-casting. Instead of tracing a […]

<<PREVIOUS | TABLE OF CONTENTS | CONTINUE >> By knowing the field of view (FOV) and the dimension of the projection plane, we can calculate the angle between subsequent rays and the distance between the player and the projection plane. These steps are illustrated inFigure 11 (Many books define these last two values arbitarily, without telling […]

<<PREVIOUS | TABLE OF CONTENTS | CONTINUE >> RAY-CASTING STEP 2: DEFINING PROJECTION ATTRIBUTES Now that we have the world, we need to define some attributes before we can project and render the world. Specifically, we need to know these attributes: 1. Player/viewer’s height, player’s field of view (FOV), and player’s position. 2. Projection plane’s dimension. […]

<<PREVIOUS | TABLE OF CONTENTS | CONTINUE >> Before we begin, let’s examine the limitation of ray casting. LIMITATIONS OF RAY-CASTING Ray casting is fast because it utilizes some geometric constraints. In most cases, walls are always at 90 degrees angle with the floor. (Note that we are not talking about the angle between walls and […]

<<PREVIOUS | TABLE OF CONTENTS | CONTINUE >> RAY-CASTING AND/VS RAY-TRACING Like ray-casting, ray-tracing “determines the visibility of surfaces by tracing imaginary rays of light from viewer’s eye to the object in the scene” (Foley 701). From both definitions, it seems that ray-casting and ray-tracing is the same. Indeed, some books use both terms interchangeably. From […]

TABLE OF CONTENTS | CONTINUE >> INTRODUCTION There has been an explosive growth in the personal computer market in the past few years*. This growth, in part, is generated by excitement and curiosity for multimedia titles. This project is an attempt to obtain some knowledge and experience on the multimedia title development process. Specifically, we […]

Ray-Casting Tutorial For Game Development And Other Purposes by F. Permadi PREFACE This document explores the fundamental theory behind ray-casting, a pseudo 3-dimensional rendering technique that are very popular in game development arena in the 90s.  In general, this document does not bother with implementation and coding detail. The discussion will be mainly about concepts, the implementation is […]

1 16 17 18