runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Matrix4x4 - more useful public properties

Open EmptyKeys opened this issue 12 years ago • 11 comments

Forward, Backward, Up, Down, Left, Right public properties for Matrix4x4

EmptyKeys avatar Nov 18 '14 12:11 EmptyKeys

I can do this :)

EmptyKeys avatar Nov 18 '14 12:11 EmptyKeys

May be it would be better to create, say, GeometricMatrix4x4 for such a purpouse. For example, matrix 4x4 may be electromagnetic field, and there are no notions of "Up" or "Down".

Despite, I not shure that I fully understand, what you mean by "Up" matrix. Is it transformation that moves local coordinates "Up"? Or what?

MPolovyi avatar Nov 19 '14 23:11 MPolovyi

This makes assumptions about the coordinate system that the transform is in, which could be right-handed or left-handed, with any orientation of the three vectors. I don't think these kinds of constants belong on the Matrix4x4 itself, but a helper class, preferably for the different coordinate system types.

XNA has constants for a right handed coordinate system, but that makes sense because they control the entire pipeline. A generic Matrix type shouldn't make these assumptions.

redwyre avatar Nov 25 '14 10:11 redwyre

This is what I'm talking about, @redwyre - the @EmptyKeys does too many assumtions, and even if it would be a helper class, I can't catch his understanding of that assumptions.

MPolovyi avatar Nov 25 '14 12:11 MPolovyi

You don't have to catch anything. :) This was simple pull request to see if MS want to go this way or not. I'm pretty sure that @mellinoe will not accept this request now after his post in similar topic on Vector3. Anyway I will in future try pull more stuff, which I changed in System.Numerics. It's up to MS guys if they want them or not.

EmptyKeys avatar Nov 25 '14 12:11 EmptyKeys

Ah, OK, thank you for explanation, @EmptyKeys , I've thought that it's the proposed change which NEEDS discussing, but it's just the pull-companion issue :).

Anyvay, I don't think that extending changes are nesessary in System.Numerics, it contains pretty base and universal stuff. May be you'd better create extension classes, then extend existing with methods?

MPolovyi avatar Nov 25 '14 16:11 MPolovyi

Seems like the particular case for putting a coordinate system helper class out there is an argument for a new class, not an extension method package.

@EmptyKeys, does having a CoordinateSystemContext class where you can plug in naming values for Up, Down, Left, Right, et al seem like the way to enrich the framework. Perhaps System.Numerics.Geometry is an appropriate namespace location (but still within System.Numerics for packaging?)

On Tue, Nov 25, 2014 at 11:08 AM, Max [email protected] wrote:

Ah, OK, thank you for explanation, @EmptyKeys https://github.com/EmptyKeys , I've thought that it's the proposed change which NEEDS discussing, but it's just the pull-companion issue :).

Anyvay, I don't think that extending changes are nesessary in System.Numerics, it contains pretty base and universal stuff. May be you'd better create extension classes, then extend existing with methods?

— Reply to this email directly or view it on GitHub https://github.com/dotnet/corefx/issues/118#issuecomment-64423876.

TetsujinOni avatar Nov 25 '14 16:11 TetsujinOni

Matrix4x4 already makes assumptions about handedness - several of the Create* methods (CreateOrthographic, CreateLookAt, CreatePerspectiveFieldOfView, etc.) assume right-handedness. So not adding Up, Down, etc., just because they make assumptions about handedness, doesn't make sense, because that's already the case.

Of course, whether these properties are useful additions, is a different matter. (I think they are, but I come from an XNA background, so I'm biased.)

Edit: I just saw the discussion in dotnet/corefx#119 where @mellinoe says:

We want to avoid forcing any particular opinion or interpretation into the data types. We want to keep these types "neutral", so to speak. "Up", "Right", "Forward" automatically force a handedness upon the user.

That makes sense, but these Create* methods on Matrix4x4 already force an opinion / interpretation.

tgjones avatar Dec 12 '14 09:12 tgjones

Thanks for waiting, @terrajobst has just posted our API Review process proposal, feel free to comment over here: https://github.com/dotnet/corefx/issues/294.

davkean avatar Dec 19 '14 01:12 davkean

@EmptyKeys If you are still interested in this, can you take a stab at writing up a speclet for all the new methods you are proposing? We can then start discussing the changes in earnest both on GitHub and eventually in an API review.

ellismg avatar Mar 24 '15 22:03 ellismg

Before I close this, I'd like to echo what Matt said above. If you still feel strongly about this, then please open a new issue with a fleshed out speclet following our guidelines. And keep in mind the considerations around handedness, etc. above.

mellinoe avatar May 22 '15 22:05 mellinoe