Rotate problem in directx [modified]
-
hi all. i have some problem in using directx to show 3d model in windows. 1.I loaded some .x file in c# and want to rotate them.but there is some problem .when a object rotate some of it's side disappear. 2.problem is that how can i set center of my object for rotate object around it not around Coordinate System . 3.when i assign some bitmap on my object it repeat many time on object surface. i want to it cover all of my object no tile on it. its code:
device.Transform.World =
Matrix.Scaling(handle.XScale, handle.YScale, handle.ZScale) *
Matrix.RotationZ(Geometry.DegreeToRadian(handle.ZRotate)) *
Matrix.RotationY(Geometry.DegreeToRadian(handle.Yrotate)) *
Matrix.RotationX(Geometry.DegreeToRadian(handle.XRotate)) *
Matrix.Translation(handle.X, handle.Y, handle.Z);for (int i = 0; i < handle.MeshMaterial.Length; i++) { device.Material = handle.MeshMaterial\[i\]; device.SetTexture(0, handle.MeshTexture\[i\]); handle.mesh.DrawSubset(i); }
handle is my object that contains my 3d info.
sepel
modified on Wednesday, September 24, 2008 3:18 AM