إنشاء بيانات عادية لجميع الشبكات في ملف 3D
Contents
[
Hide
]
باستخدام Aspose.3D for .NET ، يمكن للمطورين إنشاء بيانات عادية لجميع الشبكات في أي طراز 3D (بدون البيانات العادية).
إنشاء بيانات عادية لجميع الشبكات في ملف 3DS
يمكن استخدام طريقة GenerateNormal
التي تعرضها فئة PolygonModifier
لإنشاء بيانات عادية لجميع الشبكات في ملف 3DS. إذا تم تحديد عنصر VertexElementSmoothingGroup
في الشبكة ، فسيتم تنعيم البيانات العادية التي تم إنشاؤها بواسطة VertexElementSmoothingGroup
.
Pروغرامينغ ple وافرة
يقوم مثال الرمز هذا بتحميل ملف 3DS ، وزيارة جميع العقد وإنشاء بيانات عادية لجميع الشبكات.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET | |
// Load a 3ds file, 3ds file doesn't have normal data, but it has smoothing group | |
Scene s = new Scene(RunExamples.GetDataFilePath("camera.3ds")); | |
// Visit all nodes and create normal data for all meshes | |
s.RootNode.Accept(delegate(Node n) | |
{ | |
Mesh mesh = n.GetEntity<Mesh>(); | |
if (mesh != null) | |
{ | |
VertexElementNormal normals = PolygonModifier.GenerateNormal(mesh); | |
mesh.VertexElements.Add(normals); | |
} | |
return true; | |
}); |