問題:點圖元在本身建立的三維環境裏渲染不出來,代碼以下:orm
GMCustomVertex.PositionNormalColored wellPart = new GMCustomVertex.PositionNormalColored[wellsCount]; wellPart[i].X = (wells[i].X - point.X) * 10; wellPart[i].Y = (wells[i].Y - point.Y) * 10; wellPart[i].Z = 600f * 5; wellPart[i].Color = Color.White.ToArgb(); drawArgs.device.SetTransform(TransformState.Projection, drawArgs.WorldCamera.projectionMatrix); drawArgs.device.SetTransform(TransformState.View, drawArgs.WorldCamera.viewMatrix); drawArgs.device.SetTransform(TransformState.World, drawArgs.WorldCamera.worldMatrix); drawArgs.device.VertexFormat = GMCustomVertex.PositionNormalColored.Format; drawArgs.device.DrawUserPrimitives(PrimitiveType.PointList, wellsCount, wellPart);
解決辦法:缺乏頂點法線。blog
wellPart[i].Normal = new Vector3(0, 0, 1);