मैं इस कोड है जो WPF Viewport3D में एक घन खींचता है:एक तार फ्रेम 3 डी घन बनाना
कैसे एक के रूप में प्रस्तुत करना सुनिश्चित करने के लिए:
<Viewport3D Name="viewport3D1">
<Viewport3D.Camera>
<PerspectiveCamera x:Name="camMain" Position="6 5 4" LookDirection="-6 -5 -4">
</PerspectiveCamera>
</Viewport3D.Camera>
<ModelVisual3D>
<ModelVisual3D.Content>
<DirectionalLight x:Name="dirLightMain" Direction="-1,-1,-1">
</DirectionalLight>
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D>
<ModelVisual3D.Content>
<GeometryModel3D>
<GeometryModel3D.Geometry>
<MeshGeometry3D x:Name="meshMain"
Positions="0 0 0 1 0 0 0 1 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1"
TriangleIndices="2 3 1 2 1 0 7 1 3 7 5 1 6 5 7 6 4 5 6 2 0 2 0 4 2 7 3 2 6 7 0 1 5 0 5 4">
</MeshGeometry3D>
</GeometryModel3D.Geometry>
<GeometryModel3D.Material>
<DiffuseMaterial x:Name="matDiffuseMain">
<DiffuseMaterial.Brush>
<SolidColorBrush Color="Red"/>
</DiffuseMaterial.Brush>
</DiffuseMaterial>
</GeometryModel3D.Material>
</GeometryModel3D>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D>
यह निम्न परिणाम देता है तार फ्रेम?
धन्यवाद, लेकिन यह वास्तव में नहीं है कि मैं क्या देख रहा हूं। तस्वीर में समान प्रभाव पाने का कोई तरीका है? –
मुझे लगता है कि केवल तभी आप लाइनों को संकीर्ण ट्यूब या बक्से के रूप में बनाते हैं। आपको यह ध्यान में रखना चाहिए कि 3 डी दुनिया में 2 डी लाइन में कोई अपरिपक्वता नहीं है। जब तक कि 3 डी व्यूपोर्ट में एक साधारण रेखा खींचना संभव नहीं है - क्या यह संभव है? इसे भी देखें: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b0c79d04-37af-489f-8601-ee9c76dd12cf/ –