private Mesh Scale(Mesh mesh, float factor)
{
int[] ranks = new int[1];
ranks[0] = mesh.NumberVertices;
device.Lights.Reset();
Mesh dummy = mesh.Clone(MeshFlags.SystemMemory, CustomVertex.PositionNormalTextured.Format, device);
System.Array arr = dummy.VertexBuffer.Lock(0, typeof(CustomVertex.PositionNormalTextured), LockFlags.None, ranks);
for (int x = 0; x < arr.Length; x++)
{
CustomVertex.PositionNormalTextured cpt = (CustomVertex.PositionNormalTextured)arr.GetValue(x);
cpt.Position = Vector3.Scale(cpt.Position, factor);
arr.SetValue(cpt, x);
}
dummy.SetVertexBufferData(arr, LockFlags.None);
dummy.VertexBuffer.Unlock();
arr.Initialize();
return dummy;
}
| 닷넷 프레임워크 3.0 런타임 설치 (0) | 2007/03/14 |
|---|---|
| HLSL (0) | 2007/02/27 |
| Direct3D 메시의 크기 설정 (0) | 2007/02/14 |
| C# 이미지에 글쓰기.. (0) | 2007/02/13 |
| Direct3D 메시의 회전 (0) | 2007/02/02 |
| 3D 렌더링... (0) | 2007/01/31 |