-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to convert glm to mgl32? #53
Comments
Translating C++ glm code to Go mathgl is quite doable, since the API is modeled to be similar. For example, a C++ vec3: glm::vec3(4,3,3) Would look like this in Go: mgl64.Vec3{4, 3, 3} A bigger example: glm::mat4 View = glm::lookAt(
glm::vec3(4,3,3), // Camera is at (4,3,3), in World Space
glm::vec3(0,0,0), // and looks at the origin
glm::vec3(0,1,0) // Head is up (set to 0,-1,0 to look upside-down)
); Would be: view := mgl64.LookAtV(
mgl64.Vec3{4, 3, 3},
mgl64.Vec3{0, 0, 0},
mgl64.Vec3{0, 1, 0},
} I recommend the following resources:
|
It doesn't work!!
|
The golang code contains "github.com/veandco/go-sdl2/sdl" "github.com/go-gl/gl/v3.3-core/gl" "github.com/go-gl/mathgl/mgl32" |
What's the error message? |
Thx shurcooL!! I solved this problem!! go-gl/mathgl is a Great Gopackage! |
Good to hear. |
The text was updated successfully, but these errors were encountered: