การหมุนและการแปลงมุมมองกล้อง
Contents
[
Hide
]วิธีการเปลี่ยนการหมุนและการแปลงมุมมองกล้อง
ปัญหา: วิธีการเปลี่ยนการหมุนและการแปลงมุมมองกล้อง
เคล็ดลับ: เพื่อทำเช่นนี้ คุณสามารถรับไฟล์โดยใช้วิธีการดาวน์โหลด เปลี่ยนตำแหน่งกล้องและการหมุนโดยใช้คุณสมบัติ VectorRasterizationOptions
หมายเหตุ: ชิ้นส่วนโค้ดนี้แสดงตัวอย่างของการเปลี่ยนการหมุนและการแปลงมุมมองกล้อง โดยวิธีนี้คุณสามารถเปลี่ยนตำแหน่งของกล้องได้
ตัวอย่าง:
This file contains hidden or 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
var file = GetFileFromDesktop(@"cube_edges.step"); | |
var stp = Image.Load(file); | |
for (var x = 0; x < 360; x += 90) | |
for (var y = 0; y < 360; y += 90) | |
for (var z = 0; z < 360; z += 90) | |
{ | |
var opts = new PngOptions(); | |
opts.VectorRasterizationOptions = new CadRasterizationOptions() | |
{ | |
ObserverPoint = new ObserverPoint() | |
{ | |
AngleRotateX = x, | |
AngleRotateY = y, | |
AngleRotateZ = z, | |
} | |
}; | |
stp.Save($"stp_{x}_{y}_{z}.png", opts); | |
} |