From 1cb21c5a7575a5e127fa52398c0c56ae24f5ce36 Mon Sep 17 00:00:00 2001 From: Kai O'Reilly Date: Sun, 10 Nov 2024 13:58:42 -0800 Subject: [PATCH 1/2] fix xyz on 32-bit platforms --- xyz/io/obj/obj.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xyz/io/obj/obj.go b/xyz/io/obj/obj.go index 7baf95e30d..a205e07558 100644 --- a/xyz/io/obj/obj.go +++ b/xyz/io/obj/obj.go @@ -192,7 +192,7 @@ var defaultMat = &Material{ // Local constants const ( blanks = "\r\n\t " - invINDEX = math.MaxUint32 + invINDEX = math.MaxInt32 objType = "obj" mtlType = "mtl" ) @@ -461,7 +461,7 @@ func makeObject(name string) Object { // v [w] func (dec *Decoder) parseVertex(fields []string) error { if len(fields) < 3 { - return errors.New("Less than 3 vertices in 'v' line") + return errors.New("fewer than 3 vertices in 'v' line") } for _, f := range fields[:3] { val, err := strconv.ParseFloat(f, 32) @@ -477,7 +477,7 @@ func (dec *Decoder) parseVertex(fields []string) error { // vn func (dec *Decoder) parseNormal(fields []string) error { if len(fields) < 3 { - return errors.New("Less than 3 normals in 'vn' line") + return errors.New("fewer than 3 normals in 'vn' line") } for _, f := range fields[:3] { val, err := strconv.ParseFloat(f, 32) @@ -493,7 +493,7 @@ func (dec *Decoder) parseNormal(fields []string) error { // vt func (dec *Decoder) parseTex(fields []string) error { if len(fields) < 2 { - return errors.New("Less than 2 texture coords. in 'vt' line") + return errors.New("fewer than 2 texture coords. in 'vt' line") } for _, f := range fields[:2] { val, err := strconv.ParseFloat(f, 32) From 480e86dbca7fe57106315ffea67a5de565d30644 Mon Sep 17 00:00:00 2001 From: Kai O'Reilly Date: Sun, 10 Nov 2024 14:10:08 -0800 Subject: [PATCH 2/2] xyz readme updates --- xyz/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xyz/README.md b/xyz/README.md index 07f6c191d0..7a70fa8509 100644 --- a/xyz/README.md +++ b/xyz/README.md @@ -1,8 +1,8 @@ # XYZ -`xyz` is a 3D graphics framework written in Go. It is a separate standalone package that renders to an offscreen Vulkan framebuffer, which can easily be converted into a Go `image.RGBA`. The [xyzcore](xyzcore) package provides an integration of xyz in Cogent Core, for dynamic and efficient 3D rendering within 2D GUI windows. +`xyz` is a 3D graphics framework written in Go. It is a separate standalone package that renders to an offscreen WebGPU framebuffer, which can easily be converted into a Go `image.RGBA`. The [xyzcore](xyzcore) package provides an integration of xyz in Cogent Core, for dynamic and efficient 3D rendering within 2D GUI windows. -`xyz` is built on the [gpu](../gpu) WebGPU framework (specifically the [phong](../gpu/phong]) rendering system, and uses the [tree](../tree) tree structure for the scenegraph. It currently supports standard Phong-based rendering with different types of lights and materials. It is designed for scientific and other non-game 3D applications, and lacks almost all of the advanced features one would expect in a modern 3D graphics framework. Thus, its primary advantage is its simplicity and support for directly programming 3D visualizations in Go, its broad cross-platform support across all major desktop and mobile platforms, and the use of WebGPU which is highly efficient. +`xyz` is built on the [gpu](../gpu) WebGPU framework (specifically the [phong](../gpu/phong) rendering system, and uses the [tree](../tree) tree structure for the scenegraph. It currently supports standard Phong-based rendering with different types of lights and materials. It is designed for scientific and other non-game 3D applications, and lacks some of the advanced features one would expect in a modern 3D graphics framework. Thus, its primary advantage is its simplicity and support for directly programming 3D visualizations in Go, its broad cross-platform support across all major desktop, mobile, and web platforms, and the use of WebGPU which is highly efficient. * The [physics](physics) sub-package provides a physics engine for simulating 3D virtual worlds, using xyz.