gpt4 book ai didi

c# - 如何导出从 Grasshopper 烘焙的顶点颜色,Rhino3d 在 Unity、Unreal 等游戏引擎中或直接在 webXr 中实时分析?

转载 作者:太空宇宙 更新时间:2023-11-03 14:53:10 25 4
gpt4 key购买 nike

我对这个社区还很陌生。

我想知道如何从 Grasshopper/Rhino 3D 导出​​ Karamba 的 Vertex 颜色、Ladybug 的分析(颜色映射)以创建 AR 应用程序(使用 unity、unreal 或其他)?

我正在尝试可视化分析,我在 Rhino 中从其他 Grasshopper 插件(如瓢虫、karamba、蜜蜂、蝴蝶)中以统一或虚幻的方式烘焙。而且,我想更深入地了解纹理、 Material 和着色器在 GPU 中的 Rhino 和 Unity 中是如何工作的。

最佳答案

Rhino6 支持导出顶点颜色,您还可以使用 Antonello di Nunzio 的 Ladybug Texture Mixer 来完成这项工作,将颜色顶点替换为纹理和 Material 。

def makeTexture(size, colorTree):
sb = size * 2 - 1
bm = System.Drawing.Bitmap(size * 2, size * 2)
bmb = System.Drawing.Bitmap(size * 4, size * 4)

count = -1
for x in xrange(size):
for y in xrange(size):
count += 1
if count < len(colorTree):
bm.SetPixel((x * 2) + 0, sb - ((y * 2) + 0), colorTree[count][0])
bm.SetPixel((x * 2) + 1, sb - ((y * 2) + 0), colorTree[count][1])
bm.SetPixel((x * 2) + 1, sb - ((y * 2) + 1), colorTree[count][2])
bm.SetPixel((x * 2) + 0, sb - ((y * 2) + 1), colorTree[count][3])

g = System.Drawing.Graphics.FromImage(bmb)
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor
g.DrawImage(bm, 0, 0, size * 4 + 1, size * 4 + 1)

return bmb

关于c# - 如何导出从 Grasshopper 烘焙的顶点颜色,Rhino3d 在 Unity、Unreal 等游戏引擎中或直接在 webXr 中实时分析?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50902434/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com