Code Monkey home page Code Monkey logo

atomic-haxe-math's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

atomic-haxe-math's Issues

Strange Quat.fromEuler results

I tried porting my stuff from hxmath to atomic-haxe-math again today. Everything worked great except for one thing, which I debugged down to the following expression:

return new Mat4().fromQuat(Quat.fromEuler(X, Y, Z));

I replaced the Quat.fromEuler function with this (as described here: http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/):

var q = new Quat();
var c1:Float = Math.cos(x/2);
var s1:Float = Math.sin(x/2);
var c2:Float = Math.cos(y/2);
var s2:Float = Math.sin(y/2);
var c3:Float = Math.cos(z/2);
var s3:Float = Math.sin(z/2);
var c1c2 = c1*c2;
var s1s2 = s1*s2;
q[3] =c1c2*c3 - s1s2*s3;
q[0] =c1c2*s3 + s1s2*c3;
q[1] =s1*c2*c3 + c1*s2*s3;
q[2] = c1 * s2 * c3 - s1 * c2 * s3;
    return q;

It fixed my problem. I don't know if this issue is a quirk in atomic engine or if it's a bug.

x, y, z, w fields

Using properties, it's possible to add these fields for convenience while still conserving array read/write operations under the hood.

Coordinate system

I don't know where else to ask :(

I tried replacing my current math lib with this one, but eventually gave up when i couldn't produce the same results. Admittedly, there are lots of calculations i had to adapt from the old lib to this one, and i probably made a mistake somewhere. Still, i may as well weed out this possible cause.

When using the glm helper functions (perspective, lookAt), what is the expected coordinate system?

a usable example with math and atomic-haxe

just a suggestion that a example which shows what atomic-haxe can do would be great.

if it is good for things like moving platforms etc, like the physics platformer demo, then would be good to show off the power of the haxe definitions ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.