Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions xyz/README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
8 changes: 4 additions & 4 deletions xyz/io/obj/obj.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ var defaultMat = &Material{
// Local constants
const (
blanks = "\r\n\t "
invINDEX = math.MaxUint32
invINDEX = math.MaxInt32
objType = "obj"
mtlType = "mtl"
)
Expand Down Expand Up @@ -461,7 +461,7 @@ func makeObject(name string) Object {
// v <x> <y> <z> [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)
Expand All @@ -477,7 +477,7 @@ func (dec *Decoder) parseVertex(fields []string) error {
// vn <x> <y> <z>
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)
Expand All @@ -493,7 +493,7 @@ func (dec *Decoder) parseNormal(fields []string) error {
// vt <u> <v> <w>
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)
Expand Down