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://www.codercto.com/soft/d/14386.html

复杂性思考

复杂性思考

Allen B. Downey / 张龙 / 机械工业出版社 / 2013-5 / 49.00元

本书的灵感来源于无聊与迷恋的感觉:对常规的数据结构与算法介绍的无聊,对复杂系统的迷恋。数据结构的问题在于教师在教授这门课程的时候通常不会调动起学生的积极性;复杂性科学的问题在于学校通常不会教授这门课程。 2005年,我在欧林学院讲授了一门新课程,学生要阅读关于复杂性的主题,使用Python进行实验,并学习算法与数据结构。当我在2008年再次讲授这门课程时,我写了本书的初稿。 在2011......一起来看看 《复杂性思考》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试