Does that sound like fun?Ĭoordinates in two-dimensional space are expressed as number pairs (X, Y), which correspond to a location on the screen 3D coordinates are in the form (X, Y, Z) and, conceptually, the Z axis is orthogonal to the screen. It’s also possible to convert the 2D coordinates of a path geometry into 3D coordinates, and then manipulate these 3D coordinates before converting them back into 2D to display the path geometry normally. You can then manipulate the coordinates of these lines and curves to distort the text characters in various ways. If you’ve been following this column in recent months, you know it’s possible to call the GetGlyphRunOutline method of an object that implements the IDWriteFontFace interface to obtain an ID2D1PathGeometry instance that describes the outlines of text characters in terms of straight lines and Bézier curves. I’ll commence this exploration with a review of 3D coordinates and coordinate systems. This relationship between Direct2D and Direct3D becomes more apparent as you begin exploring the nether regions of Direct2D. Architecturally, Direct2D is built on top of Direct3D, which allows Direct2D to also take advantage of the hardware acceleration of the GPU. I guess it shouldn’t be all that surprising that Direct2D incorporates some 3D features. You can get your 3D feet wet in Direct2D so a later plunge into Direct3D programming is a little less shocking. Moreover, these 3D concepts can be encountered and explored gradually, and you get the satisfaction of actually seeing the results on the screen. ![]() Through features such as geometry tessellation (the decomposition of complex geometries into triangles) and 2D effects using shaders (which consist of special code that runs on the graphics processing unit, or GPU), it’s possible to exploit some powerful 3D concepts while still remaining within the context of Direct2D. Interestingly, Direct2D includes some concepts and facilities that originated in the 3D programming universe. DirectX doesn’t allow you to be a little bit country, a little bit rock-and-roll. Although you can mix 2D and 3D content on the same output device, these are very distinct and different programming interfaces, and there’s no middle ground. Consequently, the visual feedback so important to learning graphics programming is delayed until all the programming pieces are in place and working in harmony.ĭirectX acknowledges the profound difference between 2D and 3D graphics programming with the division between Direct2D and Direct3D. A lot of preliminaries are required to get just a little 3D on the screen, and even then a slight miscalculation can render it invisible. ![]() 3D graphics programming requires you to master new and exotic concepts beyond anything encountered in the conventional 2D world. Not quite! Anyone who’s dabbled in 3D graphics programming knows how difficult it is. ![]() If you’re well-versed in 2D graphics, you might assume that 3D is similar except for the extra dimension. Volume 29 Number 2 DirectX Factor : A 2D Portal into a 3D World
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |