p.draw = function(program, parentMVMatrix) { mat4.set( parentMVMatrix, this.mvMatrix); // copy the mvMatrix, so we don't change the original // funky stuff going on below, I don't know why it is needed, but otherwise ship rotation is wrong // found this code by trial and error mat4.set( this.matrix, this.temp2); mat4.inverse(this.temp2); mat4.copyPosition( this.matrix, this.temp2); mat4.multiply( this.mvMatrix, this.temp2);
for (var i = 0; i < this.children.length; i++) { this.children[i].draw( program, this.mvMatrix);
Since Pong is a tag at main site SO and not a tag on gamedev, is the preferred place to ask about Pong on SO even if Pong is game development? I saw that Pong runs on some FPGA and asked about it it but I think it got too localized.
I would suggest having a back and up vector for each ship (getting the "right" vector with cross product) and take full control over orientation and position
Does anyone know why glmatrix ( 1.x ) defines mat4.translate like this:
/**
* Translates a matrix by the given vector
*
* @param {mat4} mat mat4 to translate
* @param {vec3} vec vec3 specifying the translation
* @param {mat4} [dest] mat4 receiving operation result. If not specified result i...
the top left 3x3 part of the matrix is only orientation information. it redefines which way is right, which way is up, and which way is behind you. the last column is your position transformed by that coordinate system
p.getDir = function() { var mat = this.matrix; this.dir[0] = mat[2], this.dir[1] = mat[6], this.dir[2] = mat[10]; return this.dir; }
// get the values from column 1. They represent the up vector of this matrx p.getUp = function() { var mat = this.matrix; this.up[0] = mat[1], this.up[1] = mat[5], this.up[2] = mat[9]; return this.up; }
// get the values from column 0. They represent the left vector of this matrx p.getLeft = function() { var mat = this.matrix; this.left[0] = mat[0], this.left[1] = mat[4],
ok back to the "deal"... so here is the deal, i had basic stuff working camera was flying beautifully a ship was static 100 units in fornt of the origin i could fly around the ship and i could shoot lasers
what they do is, since there is a 4 cycle latency, they just put out the 4 ops consecutively, then it is as if they have a 1-cycle latency, because by the time you issue the 4 ops, first one issued is done
amd has actual vectors, nvidia spreads out the latencies like that.
so back to the deal, i had basic stuff working camera was flying beautifully a ship was static 100 units in front of the origin i could fly around the ship and i could shoot lasers
Does anyone know why glmatrix ( 1.x ) defines mat4.translate like this:
/**
* Translates a matrix by the given vector
*
* @param {mat4} mat mat4 to translate
* @param {vec3} vec vec3 specifying the translation
* @param {mat4} [dest] mat4 receiving operation result. If not specified result i...
am i correct to say, that using the original translate function, if i translate a matrix4 "looking a bit up at the sun" with [10, 0, 0] it would move 10 units towards the sun ?
here's what I'm trying to say: if your current orientation is looking down, and you move forward "W" style, then it will actually convert your -Z movement into a -Y movement
isn't that exactly the same algo as in my stackoverflow question `?
mat[12] = mat[0] * x + mat[4] * y + mat[8] * z + mat[12]; mat[13] = mat[1] * x + mat[5] * y + mat[9] * z + mat[13]; mat[14] = mat[2] * x + mat[6] * y + mat[10] * z + mat[14]; mat[15] = mat[3] * x + mat[7] * y + mat[11] * z + mat[15];
you can make a matrix multiply routine that ONLY does the rotation part and it ignores the translation part. you would use it to transform a direction vector into the coordinate system
I'm trying to go with it, reminding me of trial and error hacking together the transforms years ago
was a lot more fun to really take control of transforms
it's all about dot product of anything with a unit vector. once you 100% understand how dotting the x y and z with the rows of the matrix works, it all becomes easy
Got a comment insta-removed on SO. Someone asked a question with "Good old C#" in the title. I said in a comment "There's nothing 'good' or 'old' about C# ;)"
even though I know this is not entirely true, I thought it was funny
Yeah. I'll have to pick it up on Friday after work since I'm working from home today and tomorrow. Damn you rural Wisconsin and your lack of game stores!
@SpicyWeenie is your question actually Java/OpenGL specific or could someone knowledgable of game dev answer your question? My recommendation is just ask it and see if anyone answers
the best way to distinguish it is to find a recording that's really sharp and well made (I like to use Monolake - Inifinite Snow). Listen to it on $10 headphones, then $400 headphones. Then find the price point where the sound/cost makes sense for your budget.
also check a lot of brands. We heard some $100 Koss headphones that were really quite awesome for their price
you might try a $100 set of headphones and compare to the new Sennheiser Momentum ones. They're $400. If you don't hear a difference there, then you don't need to worry about it. :)
I'm not the kind who tells people they're dumb if they don't hear the difference. :)
I get ridiculed by someone I know for not distinguishing between CD and compressed audio (256 kbps AAC, specifically). But he won't take a blinded test, so I just laugh him off.
I have taken a blinded test, so I know for sure I cannot distinguish them
he has multiple iPods with different alphabetic sections of his collection since he insists on uncompressed audio files.