[X3D-Ecosystem] Next project? GoX3D
John Carlson
yottzumm at gmail.com
Sat Sep 6 06:37:25 PDT 2025
First fully serialized scene from generated Go, no hand editing post
generation, attached. Rubik's spheres, plus Go code. I'll start a
regression test harness now.
John
On Wed, Sep 3, 2025 at 9:11 AM John Carlson <yottzumm at gmail.com> wrote:
> Okay, I ran into a fundamental problem where I had a conflict with putting
> X3DStatements into places where X3DNode goes, so I just added functions in
> X3DNode into X3DStatement. It wouldn’t validate with libxml2, but at least
> I got output.
>
> I hope this is kosher, I couldn’t find another way yet.
>
> On Tue, Sep 2, 2025 at 8:42 AM John Carlson <yottzumm at gmail.com> wrote:
>
>> Stylesheet hounds may want to: Go SAIL!
>>
>>
>> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/lib/stylesheets/CreateX3DGSAIL.xslt
>>
>> Well, I've generated one XML scene using GoLang.
>>
>> Thanks to Don Brutzman and Loren Peitso for their efforts on X3DPSAIL, a
>> direct ancestor of this project.
>>
>> No, it doesn't do containerField. Urgh! Do not add containerField to
>> this project! ;) Sure, be my guest!
>>
>> Issues can go to this project, but I've had one night of Go programming,
>> so don't expect fixes soon. coderextreme/gox3d: Go X3D API
>> <https://github.com/coderextreme/gox3d> Sample main.go program included.
>>
>> The JSON Schema API generator ended up being a red herring. I'm not sure
>> where this project will end up.
>>
>> I'm guessing I can put together a GoSerializer.js without too much
>> issue. Contributed X3dToGo.xslt welcome!
>>
>> I don't really plan to export anything other than XML, but you can sure
>> can request others!
>>
>> John Carlson
>>
>> On Tue, Sep 2, 2025 at 3:13 AM John Carlson <yottzumm at gmail.com> wrote:
>>
>>> Got enough to get a simple valid JSON scene validated with npx
>>> x3dvalidate:
>>>
>>> package main
>>>
>>> import (
>>> "fmt"
>>> "encoding/json"
>>> "gox3d/x3d"
>>> )
>>>
>>> func main() {
>>> root := &x3d.Root{
>>> X3D: x3d.X3D{
>>> Profile: "Full",
>>> Version: "4.0",
>>> Encoding: "UTF-8",
>>> Head: &x3d.Head{
>>> Meta: x3d.Meta{
>>> {Name: "title", Content:
>>> "Initial.go"},
>>> {Name: "creator", Content: "John
>>> Carlson"},
>>> {Name: "description", Content:
>>> "Second Go scene"},
>>> },
>>> },
>>> Scene: x3d.Scene{},
>>> },
>>> }
>>> jsonData, err := json.Marshal(root)
>>> if err != nil {
>>> fmt.Printf("Error marshaling to JSON: %v\n", err)
>>> return
>>> }
>>>
>>> fmt.Println(string(jsonData))
>>> }
>>>
>>> Result (validated, but incorrect due to Scene before head):
>>>
>>> {"X3D":{"@profile":"Full","@version":"4.0","Scene":{},"encoding":"UTF-8","head":{"meta":[{"@content":"Initial.go","@name":"title"},{"@content":"John
>>> Carlson","@name":"creator"},{"@content":"Second Go
>>> scene","@name":"description"}]}}}
>>>
>>> Time for a GoSerializer.js yet? Maybe I will be able to produce JSON
>>> myself!
>>>
>>> Hmm!
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20250906/050e2235/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scene.x3d
Type: model/x3d+xml
Size: 3750 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20250906/050e2235/attachment-0001.x3d>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rubik.go
Type: application/octet-stream
Size: 15700 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20250906/050e2235/attachment-0001.obj>
More information about the X3D-Ecosystem
mailing list