3D 模型图渲染 path tracer

码农软件 · 软件分类 · 3D图形处理库 · 2019-09-11 19:28:35

软件介绍

pt 是用 Go 语言实现的 path tracer 用于渲染各种 3D 模型图。

示例代码:

package main

import (
    "log"

    "github.com/fogleman/pt/pt"
)

func main() {
    scene := pt.Scene{}
    wall := pt.SpecularMaterial(pt.HexColor(0xFCFAE1), 2)
    scene.Add(pt.NewSphere(pt.Vector{4, 7, 3}, 2, pt.LightMaterial(pt.Color{1, 1, 1}, 1, pt.NoAttenuation)))
    scene.Add(pt.NewCube(pt.Vector{-30, -1, -30}, pt.Vector{-8, 10, 30}, wall))
    scene.Add(pt.NewCube(pt.Vector{-30, -1, -30}, pt.Vector{30, 0.376662, 30}, wall))
    material := pt.GlossyMaterial(pt.Color{}, 1.5, pt.Radians(30))
    mesh, err := pt.LoadOBJ("examples/gopher.obj", material)
    if err != nil {
        log.Fatalln("LoadOBJ error:", err)
    }
    mesh.SmoothNormals()
    scene.Add(mesh)
    camera := pt.LookAt(pt.Vector{8, 3, 0.5}, pt.Vector{-1, 2.5, 0.5}, pt.Vector{0, 1, 0}, 45)
    pt.IterativeRender("out%03d.png", 10, &scene, &camera, 2560/4, 1440/4, -1, 16, 4)
}

本文地址:https://codercto.com/soft/d/14386.html

超级运营术

超级运营术

韩叙 / 中信出版社 / 2017-5

新产品上线,为什么仅仅500次转发能带来300个内测用户? 为什么每一次内容推送,都带来App的一次卸载高峰? 同类活动那么多,怎样做才能超越竞品,占据头条? 为什么有的文案像“小广告”,有的文案像贴心老友? 创业公司与大平台的玩法有何不同? …… 如何从“了解运营”到“精通运营”,可能是运营人*的困惑。《超级运营术》正是对这个问题的全面解答。韩叙总结10年运营......一起来看看 《超级运营术》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具