從世界坐標系到觀察坐標系的變換,該變換時攝像機變換至坐標系原點並使攝像機光軸沿著z軸正方向。
視圖坐標的變換矩陣可以通過如下的D3DX函數計算得到:
D3DXMATRIX *WINAPI D3DXMatrixLookAtLH(
D3DXMATRIX *pOut,
CONST D3DXVECTOR3 *pEye,
CONST D3DXVECTOR3 *pAt,
CONST D3DXVECTOR3 *pUp
);
*pOut // 指向返回的視圖矩陣
這個函數用來控制攝影機,用來控制視圖矩陣的。
pEye 攝影機位置,觀察的方向。// 照相機在世界坐標系的位置
pAt 參數指定照相機所觀察的世界坐標系中的一個目標點,攝影機的前進和後退,向左或向右。向上或向下。
pUp 參數指定3D世界中的上方向,通常設Y軸正方向為上方向,即取值為(0,1,0)。
指針 D3DXMATRIX結構,結果該運算。
pEye [in]:
Pointer to the D3DXVECTOR3 structure that defines the eye point. This value is used in translation.
指針 D3DXVECTOR3結構,它定義了eye位置。這個值用於位移。
pAt [in]:
Pointer to the D3DXVECTOR3 structure that defines the camera look-at target.
指針 D3DXVECTOR3結構,它定義了相機注目目標。
pUp [in]
Pointer to the D3DXVECTOR3 structure that defines the current world's up, usually [0, 1, 0].
指針 D3DXVECTOR3結構,它定義了當前世界座標向上的向量,一般[0,1,0]。
Return Value
回傳值
Type: D3DXMATRIX
Pointer to a D3DXMATRIX structure that is a left-handed, look-at matrix.
指針 D3DXVECTOR3結構,它定義了左手矩陣和視圖矩陣
createps 發表在 痞客邦 留言(0) 人氣(268)
SetVertexShader專門設置可編程渲染管道的Shader程序,vs(vertex
shader)用SetVertexShader來傳入。
SetFVF設置固定渲染管道的頂點格式,FVF用SetFVF來傳入。
createps 發表在 痞客邦 留言(0) 人氣(116)
Bump Mapping
Bump mapping is very much like Texture Mapping. However, where Texture
Mapping added colour to a polygon, Bump Mapping adds, what appears to be surface
roughness. This can have a dramatic effect on the look of a polygonal object.
Bump Mapping can add minute detail to an object which would otherwise require a
large number of polygons. Note that the polygon is still physically flat, but
appears to a be bumpy.
Take a look at the cube on the left. If you look
closely, you can see lots of detail on it. It looks as if it must have been made
from millions of tiny polygons, but is made from just 6. You might ask how this
differs from Texture Mapping. The difference is that a Bump Map is a Texture Map
that responds to the direction of the light.
凹凸貼圖是很像紋理貼圖。但是,如果將紋理映射到多邊形的顏色,凹凸映射補充說,這似乎是表面粗糙度。這可能有一個戲劇性的效果就看一個多邊形對象。凹凸貼圖微小的細節可以添加到一個對象,否則將需要大量的多邊形。請注意,仍然是身體上的多邊形平坦,但似乎是一個充滿坎坷。
看看這個立方體的左邊。如果你仔細觀察,可以看到大量的細節就可以了。這看起來好像它必須已經從數百萬微小的多邊形,但是是由只有6。你可能會問這不同於紋理映射。所不同的是,凹凸貼圖紋理貼圖是響應該方向的光。
createps 發表在 痞客邦 留言(0) 人氣(241)
因為一個好朋友的老婆的建議,所以我馬上又寫了一個"統一發票對獎程式"。
希望大家喜歡^^
下載網址:
http://redtreeonline.com/other/fapu.exe
下面是畫面:
createps 發表在 痞客邦 留言(0) 人氣(1,455)
方法一:
this.texBox.KeyPress += new KeyPressEventHandler(HandleKeyPress);
private void HandleKeyPress(object sender, KeyPressEventArgs e)
{
if (!char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar))
e.Handled = true;
}
createps 發表在 痞客邦 留言(0) 人氣(4,790)
physics.setGravity()
Description:
Sets the x,y components of the global gravity vector, in units of m/s2. The default is ( 0, 9.8 ) to simulate standard Earth gravity, pointing downwards on the y-axis.
設置 x,y分量的全球重力載體,單位 m/s2。默認為(0,9.8)的標準來模擬地球引力,向下在Y軸。
createps 發表在 痞客邦 留言(0) 人氣(137)
physics.setScale()
Description:說明:
Sets the internal pixels-per-meter ratio that is used in converting between onscreen Corona coordinates and simulated physics coordinates. This should be done only once, before any physical objects are instantiated.
設置內部像素的每米的比例,用於在屏幕上的Corona坐標之間的轉換和模擬物理坐標。這項工作應該只有一次,在任何物理對象被實例化。
Changing this value has no visual consequences, and simply affects the accuracy of the physical model. The Box2D engine is tuned for simulating medium-sized objects between 0.1m and 10m in size, so it works best when the objects in your game are mapped to physical properties that fall roughly within this range.
改變這個值沒有視覺的後果,影響了準確性和簡單的物理模型。該 Box2D的發動機調整為模擬中等大小的物體之間的0.1米和10米的大小,因此它最適合當你的遊戲中的對象映射到物理特性大致屬於這個範圍之內。
The default scaling value is 30, which means that the optimal 0.1m to 10m range corresponds to visible sprites between 3 and 300 pixels in size, which should cover most typical iPhone content. For higher-resolution devices like iPad, Android, or iPhone 4, you may wish to increase this value to 60 or more.
默認縮放值是30,這意味著最佳0.1米至10米範圍對應於可見精靈3至300像素的大小,它應該包括最典型的iPhone內容。對於高解析度設備如iPad的,Android,或iPhone4,您可能希望增加該值到60以上。
createps 發表在 痞客邦 留言(0) 人氣(60)
body.isBullet
Description:
A boolean for whether the body should be treated as a “bullet”. Bullets are subject to continuous collision detection, rather than periodic collision detection at world timesteps. This is more computationally expensive, but it prevents fast-moving objects from passing through solid barriers. The default is false.
一個布爾該機構是否應被視為一個“子彈頭”。子彈都受到連續碰撞檢測,碰撞檢測,而不是定期在世界時間步。這是更昂貴的計算,但它可以防止快速移動的物體從穿過堅實屏障。默認為 false。
在body碰撞判斷時,如果速度很的碰撞,會有無法判斷碰撞的現象發生,如果把body.isBullet設定為true,那就可以很精密的判斷碰判,這可能會降低效能,因為cpu一直在計算。
createps 發表在 痞客邦 留言(0) 人氣(42)
body.angularDamping
Description:
The numerical value for how much the body's rotation should be damped. The default is zero.
其數值為多少身體的轉動應阻尼。默認是零。
如果:
*.angularDamping = 0.8 -- stops balls from spinning forever 從紡紗永遠停止球
Syntax:
body.angularDamping
Example:
myBody.angularDamping = 5
local d = myBody.angularDamping
Returns:
Number
Remarks:
Supported on operating systems and platforms for build numbers shown:
Mac OS X:Build 2010.222
Windows: Build 2010.222
iOS: Build 2010.222
Android: Build 2010.222
Related:
createps 發表在 痞客邦 留言(0) 人氣(57)
body.linearDamping
The numerical value for how much the body's linear motion is damped. The default is zero.
其數值為多少身體的直線運動被抑制。默認是零。
如果:
*.linearDamping = 0.3 --可以模擬摩擦毛氈
Syntax:
body.linearDamping
Example:
myBody.linearDamping = 5
local d = myBody.linearDamping
Returns:
Number
Remarks:
Supported on operating systems and platforms for build numbers shown:
Mac OS X:Build 2010.222
Windows: Build 2010.222
iOS: Build 2010.222
Android: Build 2010.222
Related:
createps 發表在 痞客邦 留言(0) 人氣(97)