Jump to content

  • Log In with Google      Sign In   
  • Create Account

Hieroglyph 3 engine using custom vector and matrix objects?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 mrheisenberg   Members   -  Reputation: 356

Like
0Likes
Like

Posted 01 November 2012 - 04:31 PM

I was looking at this engine(Hieroglyph 3) I think it was actually written by a member of this forum.Anyway,the code is really clean and organized and the sample apps run with excellent performance,however I don't understand why the author created custom vectors(Vector2f,Vector3f..) and custom matrices(Matrix3f,Matrix4f...) when there's DirectXMath with the SIMD wrappers.Maybe he wanted to abstract it from DirectX,so it's not DirectX reliant?Cause I thought you can actualy use DirectXMath/Xnamath on it's own without D3D and the other APIs.Please correct me if I'm wrong.

Sponsor:

#2 ATEFred   Members   -  Reputation: 1125

Like
0Likes
Like

Posted 01 November 2012 - 06:32 PM

I can't speak for the reasoning behind rolling a custom math lib in H3, but I wrote my own for my engine as a learning experience, and because I could tailor the api to what I think is most practical to work with. Also, when msoft decide to move their math lib to a different sdk / drop support for it / rename it / change interfaces / etc. (as they tend to do from time to time), I won't have to do any work on my side. Same reason why I don't use their d3dx texture and mesh loading helper functions.

#3 MikeBMcL   Members   -  Reputation: 172

Like
0Likes
Like

Posted 01 November 2012 - 06:33 PM

When he (Jason Zink) started writing Hieroglyph3 there was no DirectXMath nor any XNAMATH. According to the book he co-wrote, Practical Rendering & Computation with Direct 3D 11, he started the project in 2000 with D3D 8. I'm not even sure if there was a D3DX math back then, honestly. I expect he created the custom structures and math functions simply to fill a void (or possibly as a learning experience) and has kept them up to now since changing away from them would be a big undertaking. I think he does have plans to switch to DirectXMath, but I'm not positive and it would be quite a few hours of free time needed to complete it and test it out at any rate.

#4 jbadams   Senior Staff   -  Reputation: 19366

Like
0Likes
Like

Posted 01 November 2012 - 07:16 PM

Jason often blogs about Hieroglyph3 (and more general concepts) in his developer journal here at GDNet, you might be able to find additional information there. Posted Image

#5 Jason Z   Crossbones+   -  Reputation: 5316

Like
1Likes
Like

Posted 01 November 2012 - 08:49 PM

You guys have it more or less right on - I started the library when I was just learning about graphics programming (and C++ for that matter...), so it was originally a learning exercise. When I started out, I followed Dave Eberly's Wild Magic engine, and he also used a series of custom match classes. Since his work was so well known, I followed along and converted them to non-templated versions, learning while I went along. I can also give the advice that it is very much worth the effort to implement your own math classes - even if you don't use them (for performance reasons or whatever) it is very instructive on a number of levels.

Regarding the lack of updating to something like DirectXMath, it is mostly because I don't do lots of CPU math in the engine. There are some matrix multiplications, but not really anything that could take advantage of heavy duty SIMD operations. Because of churn in the math libraries over the past few years (D3DX, XNAMath, DirectXMath, etc...) it has been a practical choice for me to stick with the CPU based classes. My development time seems to be much lower than it has traditionally been, so I have to pick my battles wisely :)

Thanks for the kind words about the engine - it is a labor of love, and it is nice to hear your feedback on it!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS