Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
github.com/shikanon/gocanvas
GoCavans是一个golang封装的3D模型动画演示库,提供了gltf、obj、fbx等多种模型格式加载,支持天空盒、灯光和脚本动画编辑等功能。相比于g3n等3D框架,GoCavans 更轻量并且简单易用。
如果你想快速体验,可以运行 demo示例:
import (
"fmt"
"net/http"
gocanvas "github.com/shikanon/gocanvas/pkg/canvas"
)
func render(w http.ResponseWriter, r *http.Request) {
app := gocanvas.NewApplication(w)
scene := app.Scene()
// 创建一个摄像机
camera := gocanvas.DefaultCamera()
// 创建一个天空盒
skybox := gocanvas.DefaultSkybox()
// 创建一个灯光
light := gocanvas.DefaultLight()
// 创建一个模型
model, err := gocanvas.LoadGLTFModel("./assets/corvette_stingray/scene.gltf")
if err != nil {
fmt.Fprintln(w, err.Error())
return
}
// 加入到场景中
scene.AddCamera(camera)
scene.AddSkyBox(skybox)
scene.AddLight(light)
scene.AddModel(model)
// 渲染
err = scene.Render()
if err != nil {
fmt.Fprintln(w, err.Error())
return
}
}
func main() {
http.HandleFunc("/", render)
http.Handle("/src/", http.FileServer(http.Dir("")))
http.Handle("/assets/", http.FileServer(http.Dir("")))
http.ListenAndServe(":8080", nil)
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.