![]() The right direction means the positive direction of the x-axis, and the up direction means the positive direction of the y-axis. You can use the triangle you drew in the previous section. Or, if you already know that transformations can be written using a matrix, you can skip this section as well.įirst, let’s write a sample program, TranslatedTriangle, that moves a triangle 0.5 units to the right and 0.5 units up. If you find reading this section and in particular the math too much on first read, it’s okay to skip it and return later. However, when you write your own programs, you don’t need the math instead, you can use one of several convenient libraries, explained in the next section, that handle the math for you. This section introduces some math to explain each transformation and help you to understand how each operation can be realized. These operations are called transformations (affine transformations). ![]() Now that you understand the basics of drawing shapes like triangles and rectangles, let’s take another step and try to move (translate), rotate, and scale the triangle and display the results on the screen. Learn More Buy Moving, Rotating, and Scaling WebGL Programming Guide: Interactive 3D Graphics Programming with WebGL
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |