一个接口可从一个或多个基接口继承。在下例中,接口 IMyInterface
从两个基接口 IBase1
和 IBase2
继承:
interface IMyInterface: IBase1, IBase2 { void MethodA(); void MethodB(); }
接口可以由类和结构实现。实现的接口的标识符出现在类的基列表中。例如:
class Class1: Iface1, Iface2 { // class members }
~~~~~~~~~end~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IDirecxt3DDevice9接口继承IUnknown接口,IUnknown 有几个方法。
把IDirect3DDevice9作为私有成员,(应该来说,不用其作私有成员也可以。(试试)把IDirect3DDevice9作为私有成员的好处是,draw函数就不需要device参数了!!!!直接用device成员)
2,vertex buffer;index buffer:确实这两个是对一个确定的对象而言的。应该是其私有成员。
3,其他```(漏这么多ToT!!!!)
int _cellSpacing;
int _numCellsPerRow; _numVertsPerRow - 1
int _numCellsPerCol; _numVertsPerCol - 1
int _width; _width = _numCellsPerRow * _cellSpacing;
int _depth;
int _numVertices; _numVertices = _numVertsPerRow * _numVertsPerCol;
int _numTriangles; _numCellsPerRow * _numCellsPerCol * 2;
float _heightScale;(灰度图灰度值的除数,用于控制地形的突兀程度,越大地形表现的越平坦)
It now refers to the number of bytes in a row of blocks
- Wrap Texture Address Mode
- Mirror Texture Address Mode
- Clamp Texture Address Mode
- Border Color Texture Address Mode
------------学习--------------------
texture warping (SDK: Texture Wrapping)
By definition, texture wrapping causes the rasterizer to take the shortest route between texture coordinate sets, assuming that 0.0 and 1.0 are coincident. The last bit is the tricky part: You can imagine that enabling texture wrapping in one direction causes the system to treat a texture as though it were wrapped around a cylinder. For example, consider the following illustration.
不明白的几个地方:
1,texture warping的纹理光栅化时,面向的单元不再是三角形的primitive了,而是这样一个圆柱体,或者立方体??
先放一放,以后再查其他资料详细了解。
明白了的几个地方:
1,texture warping 和warp mode的区别:先进行texture warping后进行warp mode,texture warping 的取值不会超过(0,1)的范围。
-------------6月18日追加------------------------------------------
texture wrapping 再仔细看了下SDK,其中有一句话
Enabling u-texture or v-texture coordinate wrapping changes how Direct3D perceives the shortest route between texture coordinates in the u-direction and v-direction
也就是说:在进行光栅化插值的时候。A,B之间光栅化插值所选取的路径不再是沿着这个纹理表面;而是穿过了seam(纹理卷起来的接合线)。
综上所述,回答问题1,应该来说,texture wrapping面向的还是三角形的primitive,只是在进行光栅化的时候,对于u,v值,然后进行插值的时候,如果可以找到渲染标识为texture wrapping,就采用texture wrapping 的插值方式。
以后有时间,尝试使用使用此技术。
原文:
This diagram shows how wrapping in the u - direction affects how the system interpolates texture coordinates. Using the same points as in the example for normal, or nonwrapped, textures, you can see that the shortest route between points A and B is no longer across the middle of the texture; it's now across the border where 0.0 and 1.0 exist together. Wrapping in the v-direction is similar, except that it wraps the texture around a cylinder that is lying on its side. Wrapping in both the u-direction and v-direction is more complex. In this situation, you can envision the texture as a torus, or doughnut.
-------------end 6月18日追加------------------------------------------