2016-06-01 6 views

답변

0

이 당신을 위해 무엇을 찾고 있는지에 따라 두 가지 방법이있다. 렌더링 래스터 화 프로그램의 상태를 와이어 프레임을 표시하도록 설정하거나 가장자리의 목록을 가져오고 VertexPositionColor 세트를 그릴 수 있습니다. GraphicsDevice.DrawIndexedPrimitives을 사용하십시오.

래스터 크기 조절기 국가는

당신은 당신이 BasicEffect를 사용하는 가정하고 투명 큐브를 그릴 수 있습니다, 당신은 음영을 모두 끄고 색을 흰색으로 설정할 수 있습니다.

그런 다음 새 rastersizer 상태를 FillMode.Wireframe으로 설정하여 큐브를 다시 그릴 수 있습니다. 여기에 의사 코드가 있습니다. 이 모든 삼각형의 얼굴을 그릴 것입니다, 그래서 당신의 큐브 얼굴을 통해 대각선이있을 줘야하기 때문에

//Draw the Cube Transparent 
DrawCubeTransparent(); 

//Now save the Rastersizer state for later 
RasterizerState originalRasterizerState = GraphicsDevice.RasterizerState; 


//Now set the RasterizerState too WireFrame 
RasterizerState newRasterizerState = new RasterizerState(); 
newRasterizerState.FillMode = FillMode.WireFrame; 
GraphicsDevice.RasterizerState = newRasterizerState; 

//Now redraw the cube as wireframe with the shading off and colour set to white 
DrawCubeWireFrame(); 

//Now reset the Rastersizer fill state 
raphicsDevice.RasterizerState = originalRasterizerState; 

DrawIndexedPrimitives

은 이전의 방법은 적합하지 않을 수 있습니다.

다른 방법은 그리려는 가장자리를 찾은 다음 DrawIndexedPrimitives를 사용하여 모든 가장자리를 포함하는 Vertices 배열을 그립니다.

간단한 google 검색은 이것을 사용하는 데 많은 예제를 제공합니다.