Inferno #05
30 апреля 2004 |
|
For Coderz - Nuances Raycasting-a.
Raycasting note Article Shiru Otaku pro reykasting was removed from the unpublished material Adventurer # 14. In accordance with the traditions of our publication (or rather, his Guide-part;), it also features my remarks. Naturally, my opinion is not true of last resort. By the way, this material, laced with enough personal misunderstanding on the part of the lecturers, taught on the course "Computer Graphics" in the area third-year specialty software providing something something and something something. "Spektrumistam study at university to I do not advise this specialty. Initially, the article contained an opinion that the character can not rotate on an axis perpendicular to the screen. Here's how: However, my part, I believe that possible. To do this, build a picture, though the hero does not revolved around this axis, and then transfer the image onto the screen in the rotated form. Of course, this can rarely be necessary, but suddenly? In the demo, for example ... Wall at 45 ° (ie, NE to SW or NW on the SE) can be realized in the standard reykastinge, and in my version, where a continuous scan. In the second case it otniet not so much CPU time, but This number teoreticheski.Poskolku the scan will be very difficult. At the entrance in each block to check whether there diagonal wall, and if so, what - according to its type must occur transition to the desired option of the inner loop. In processing the diagonal options one of the coordinates to be distorted: X = X + Y, or X = XY, or Y = X + Y, or Y = XY, in Depending on the type of wall and directions entrance to the cube. The same should be done with variables that contain step. Then the cycle will work as usual, t.e.slozhenie with access to overflow. Actually, the standard reykastinge, if the type of dice to the wall to know in advance the rate of fall was not a factor of 2. But the algorithm seems even wiser. Alone Coder
Other articles:
Similar articles:
В этот день... 21 November