Customize Non-PBR إلى aterateraterالمواد ononقبل aving aving 3D cencenإلى GLTF 2.0 orormat

Non-PBR إلى PBateraterateron

Tمثال التعليمات البرمجية له يوضح كيفية تحويل المواد إلى المواد PBR ، ومن ثم يحفظ 3D المشهد في تنسيق GLTF:

C#


import aspose.threed as a3d

# initialize a new 3D scene

s = a3d.Scene()

box = a3d.Box()

mat = a3d.shading.PhongMaterial()
mat.diffuse_color = Vector3(1, 0, 1)

s.root_node.create_child_node("box1", box).material = mat

opt = a3d.formats.GLTFSaveOptions(FileFormat.GLTF2);

# save in GLTF 2.0 format

s.save("test.gltf", opt);