-
Notifications
You must be signed in to change notification settings - Fork 52
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
Initialize a 4x4 matrix i.e. sdf.M44
#69
Comments
What about just making "Quaternion" an object within the sdf package itself? ie- it would have access to private members within M44. A couple of other points...
|
btw - looking at M22/33/44 references I think the argument could be made to split off matrix operations into their own package. Maybe Quaternions could join them there. |
Eventually, I ended up using the Quaternion provided by this Go pkg rather than my own custom Quaternion logic: https://github.com/go-gl/mathgl https://github.com/go-gl/mathgl/blob/e426c0894fa41bc41ac04704eef3ac4011b19ecf/mgl32/quat.go#L32 Data types need to be converted of course 🙂 |
I guess to do the above points, heavy modifications are needed. Probably affecting many other things. Maybe a heavy restructuring needs rigorous testing. A bit risky maybe 🤔
|
So are you doing 16 set's to initialise the M44 for your quaternion stuff? func NewM44(x []float64) M44 which initialises based on up to 16 values out of x E.g. m := sdf.NewM33([]float64{ |
I'd be curious to benchmark differences between type built with arrays vs type built with named elements. E.g. M44 as [16]float64 I guess they should be the same. The former representation makes any sort of indexed access very simple. But for a matrix maybe I should convert the representation to a x[i] form internally. |
Makes sense. |
|
Funny. TIL: ChatGPTs opinion is worth about as much as the opinion of any rando on the internet, in fact it's probably an amalgam of the opinion of said randos. |
Problem
There is no public method to declare a new instance of
sdf.M44
with the initialization of its values.The fields of the
sdf.M44
are all private:Why
The reason that I'm running into this problem is that I need to create a
Quaternion
type:But, the last statement cannot be done, I mean:
There is no way to initialize a
sdf.M44
, as far as I understand. Am I right? 🙄The text was updated successfully, but these errors were encountered: