« first day (916 days earlier)      last day (4087 days later) » 
01:00 - 20:0020:00 - 00:00

1:44 AM
ahhahaha this is so awesome xD
 
2:00 AM
pirate fb?
I did that once, in 2008 :P
but seriously it gets annoying after awhile
hey any openglers here? I'm trying to centre a cursor using glutWarpCursor, but whenever I do that my passive mouse values always stay centred
meaning I can't figure how much the mouse has moved because it's always centred...
 
2:41 AM
@Mana Avatar change O:?
 
@CodeAssassin nah, it's been this way for about a year or so
 
3:58 AM
@Almo and this is one of my solutions I really love spacechem.net/solution/no-need-for-introductions/66836
 
 
2 hours later…
5:49 AM
Hey anyone alive here ?
 
I am but I probably won't be much help if you are having questions with something
 
Hey, what's up?
 
I can problem solve but am not familiar with most technologies people use :)
 
hey
: I am struggling a bit with my WebGL game
matrix4 related stuff
anyone willing to help me out a bit ?
(only tested on chrome )
 
Looks cool. Like I said though... afraid I won't be much help. Never got into that math stuff outside of college and I don't remember much of it
 
6:02 AM
@RayHulha works well for me
 
yes
it works
but the code is ugly
 
spinning
help
 
and contains so many inversion calls
 
getting sick
 
move the mouse to the center
 
6:02 AM
oh its multimonitor
 
its inspired by freelander
 
yes I see :)
 
the current problem is, i want the enemyship to shoot laser at me
 
@RayHulha ok, the orientation is the problem? what part?
basically, you compute a vector from a source to a target by computing (target_pos - gun_pos)
 
well
the problem is i copy the matrix from the ship to the laser
position and rotations
but i had to mess with the node of the ship mesh node
so it would rotate right
i call it nodeInverse
 
6:06 AM
mess with? is it based on torques and moments etc?
 
i try to paste code
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);
that works
 
ok so you'd be happy if it instantly oriented to the target and computed laser start and end correctly?
 
i would be happy if the laser mesh would move in the direction the ship faces and starts at the ship position
 
0
Q: Should I ask Pong questions here or on SO?

Nick RosencrantzSince 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.

 
but I messed so much with the Node holding the ship mesh so it would rotate ( slerp ) correctly
that the matrix is probably messed up
 
6:09 AM
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
 
My basic question is, is it possible to have a matrix 4 as the only place to hold position and rotation informations
 
build the matrix from those
 
or is my idea just prone to fail
 
you can make it work but you need to renormalize the matrix due to roundoff error accumulation
the matrix gradually distorts
if you already do it by repeatedly modifying a matrix, you can write a "fixup" function to renormalize every 100 frames or something
you following?
 
you can make it work but you need to renormalize the matrix due to roundoff error accumulation
hm
interessting
good argument to go to Quaternions
but they have a normalize function as well
 
6:13 AM
it's not a good design to do that, makes it really inconvenient to get at the orientation and position
 
but i read they aren't as prone to the accumulation
well
i need slerp alot
so i convert to quats anyways
anychance i can call you on skype doug ?
 
normally sure, but its late and I'd rather be quiet
 
fair enough
would you be willing to check out my code a bit ?
 
you have a quat-to-matrix implementation?
sure
 
yes
i use glmatrix.net
he has a quat to mat4
 
6:17 AM
quaternion will only hold orientation though
 
mat4.fromRotationTranslation = function (quat, vec, dest) {
yea
i would use a quat and a mat4
I would just like to understand why its not working
any why i need the inverse at one point
I asked a so question
 
so you are repeatedly performing rotations/etc on matrices over several frames? Without making brand new ones over and over from inputs
 
0
Q: Can someone explain the mat4.translate function from glMatrix?

Ray HulhaDoes 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...

> so you are repeatedly performing rotations/etc on matrices over several frames? Without making brand new ones over and over from inputs
yeah
but my problem at the moment isnt accuarcy, but the need to invert so much
 
you understand how matrices work for the simple case of orthogonal transforms right?
 
and failing to understand why its needed
 
6:20 AM
like what each row means in the top left 3x3 part?
 
yes
although
not the rows
which seems to work
 
ok, then why not construct the orientation vectors directly and make the matrix from a view direction, an up, and a position
 
It felt so clever
 
well, if you want to keep the code, just make a renormalizer
 
skipping the step creating the matrix
well, again, i don't think the normalizing is my issue, it looks like an issue i need to look out for
 
6:21 AM
take the first column, crossed with second column, and rewrite 3rd column with result - or the transpose of it - orsomething. cant remember exactly
 
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
but its not my current issue
what is up with that "retry/cancel" stuff in this chat ?
 
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
 
are lines with that retry message not transmitted ?
exactly
 
they are not transmitted
 
thats why i thought a matrix 4 is perfect to use as my base variable
ah ok
and i could shoot lasers
 
6:25 AM
3x3 matrix has way too many degrees of freedom. you need to enforce orthogonality
 
well
 
I actually lived to use "orthogonality" in a sentence
 
i dont want gimbal lock
haha
I actually want that freedom, I believe
because its a space shooter and all
 
make a matrix fixup routine that recalculates the Z direction to be perpendicular to the X and Y
 
hm you saying its right, up and behind is bewildering
 
6:27 AM
then problem is solved and you can do progressive updates to the matrix
 
i thought it was left up and front
 
depends on whether you are using left-handed or right-handed coordinate system
opengl default is: +x is to the right, +y is up, +z goes behind you <- not kidding
 
it seems to me with opengles shaders, its matter of usage
 
yes you can make it be anything with a matrix multiply, I'm saying with identity matrix, what I said above is what happens
 
oh
i think i just realized i was using rows
 
6:30 AM
opengl is column-major
 
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],
 
if position isn't working then that's why, you have to either flip all your stuff or transpose it before delivering it to opengl
if the library was made for webgl, it's already right - I'll assume a guy that can make a webgl math lib knows something
 
p.getX=function()
{
return this.matrix[12];
}

p.getY=function()
{
return this.matrix[13];
}

p.getZ=function()
{
return this.matrix[14];
}
im using glmatrix.net
 
ok
 
[1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
x, y, z, 0]
The same matrix in the OpenGL documentation is written as:

1 0 0 x
0 1 0 y
0 0 1 z
0 0 0 0
 
6:33 AM
yes
 
so is my getLeft correct ?
or should it be called getRight
 
sorry it's left
just did right hand trick thing
left, up, back
 
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
 
the only dependency is the projection matrix putting everything in the right place in the result
 
yea i have that covered i think
 
6:36 AM
ok
 
gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
 
ouch!!!!
don't do that
you are doing a 4x4 * 4x4 multiply then processing the vector
 
mat4.perspective(50, canvas.width / canvas.height, 0.1, 2020.0, this.pMatrix);
 
instead do tmp = vec4(aVertexPosition, 1.0); tmp *= uPMatrixl; tmp *= uMVMatrix; gl_Position = tmp;
 
yeah but thats how the guy here does it: learningwebgl.com/lessons/lesson01/index.html
 
6:38 AM
because 4x4 * 4x1 is cheap, doing it twice is nothing
 
yeah
i saw that in a another engine
and figured as much
 
it makes a huge difference
 
really
 
4x4 * 4x4 = 64 multiplies + 48 adds
 
ok
thanks, thats a great tip
 
6:39 AM
4x4 * 4x1 = 9 multiplies + 12 adds
 
yeah makes complete sense
 
I made that mistake before
 
i read somewhere GPUs crunch matrix4 stuff
so i wasnt too worried
 
no sense wasting it though
 
true
thanks
 
6:40 AM
they don't crunch 4x4 any magic way other than pounding out all the ops and screaming through them
 
I will fix that
isn't it like SIMD stuff ?
like one operation for a GPU ?
 
not exactly, it depends if you are talking about amd or nvidia
 
fair enough, easy to fix, so why not do it, you have me convinced :)
 
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
But the lasers where already crazy to get working
 
6:45 AM
you are torturing yourself by using matrices to represent position and orientation in my opinion
 
mat4.toRotationMat( spatial.matrix, cObj.matrix);
var left = spatial.getLeft();
mat4.rotate( cObj.matrix, 0.5*Math.PI, left); // point the cylinder forward
mat4.translate( cObj.matrix, spatial.getPos());
if( spatial.type === "camera")
{
mat4.inverse( cObj.matrix);
}
 
you simply need to be able to compute a worldspace position for a certain body space coordinate
 
yea, that could very well be, and I might change it all, but first I want to understand why its not working
hey could you do me a favor
look at that so question
0
Q: Can someone explain the mat4.translate function from glMatrix?

Ray HulhaDoes 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...

I don't understand why that function does so much stuff
Here is what I use:
mat4.translate_alt = function (mat, vec, factor) {
factor = factor || 1;
mat[12] += vec[0]*factor;
mat[13] += vec[1]*factor;
mat[14] += vec[2]*factor;
}
 
what they are doing there is transforming the position into the orientation of the camera
 
yea, read my comment at the bottom
I thought that was happening
keep in mind that function does not care if its a camera
 
6:48 AM
that 2nd snippet seems restricted
 
could you paste what part u mean ?
( if you write a short answer that that SO question i would upvote and give u the right answer check )
 
wait scratch that
that wouldn't work
what that would do is move the camera in the untransformed space, doing some crazy thing
 
do you mean my translate_alt function ?
 
I'd say never use transform_alt. unless I'm overtired it doesn't make sense
 
but it works many times where translate does not
 
6:51 AM
it can work if your input vec already makes sense in the current coordinate system
when you are viewing at the "identity" orientation, transform_alt is correct
otherwise it does something crazy
 
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 ?
 
depends on the order of multiplication
 
but you know what I mean or ?
 
m = rotate(pi/4,0,0) * matrix OR m = matrix * rotate(pi/4,0,0)
where rotate returns a rotation matrix
 
I mean, mat4.translate( sun_looking_matrix_not_at_origin, [10,0,0])
 
6:56 AM
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
 
exactly
but how can that be right for all cases ?
 
that's why the code in your question does that x * foo, y * foo, etc
 
what if I want to look down and move along the z axcis
Why couldn't i use my translate_alt for that
mat4.translate_alt( sun_looking_matrix_not_at_origin, [10,0,0])
with this, I will really move it along the x axis
ah crap
I guess I meant [0,0,10]
 
it is right for all cases because of how orthogonal matrices work
 
well, thanks for your time
Dont want to bother you too much
 
7:00 AM
think of an identity matrix, x=1 y=0, z=0 for the x row
that will cause no change
same with y on 2nd row and z on 3rd row
now thing of that x row pointing in another direction, thats the x in that frame of reference
 
yeah, the identity matrix is easy to translate
 
you want to translate the matrix, in-place?
I have C code that did it...
 
yea
as i said, i only have a matrix4 in my scene graph nodes
and camera
I hoped that would be clever
 
it's the opposite order though, but easily fixed by redefining _M44 macro
its C++ - more like C actually
seems right right?
the X translation part of the new matrix is simply the current translation part dotted with the added vector
 
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];
 
7:08 AM
that's what you get if you take a translate matrix multiplied with another matrix, and throw away all the multiplies by zero
literally
that's literally how I made my implementation
 
makes sense
 
ok, maybe this will help:
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
 
makes sense
 
so here is what I use to move a scence node forward:
vec3 dir = node.getDir() // see above
mat4.translate_alt( node.getMatrix4(), dir, 1.0);
I guess I could simply use:
mat4.translate( node.getMatrix4(), [0,0,1]);
your last pastebin also makes sense
 
7:14 AM
for drawing...
what about actually keeping track of the position
 
i use the matrix[12-14] fields
 
or mat4 IS the information
 
mat4 is a library object
 
it won't work right
 
containing matrix4 functions
it has no value in it self
think of it as a namespace
ah damn it, I will probaly use a vec3 for position and a quaternion for rotation
 
7:16 AM
yes I know javascript
 
ah sorry
 
np, how would you know
 
to hell with my matrix4 idea
:D
 
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
 
i need to slerp alot
so i think switching to quaternions is good
 
7:21 AM
I use quaternions for orientation, but mine is based on accumulated torques
 
well, thanks a lot for your time !
 
no direct control
np
 
I really appreciate it
take care
 
 
7 hours later…
2:43 PM
@Chunk-e-Yamani Woa... that's an ugly one!
 
 
1 hour later…
4:01 PM
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
 
I love C#
 
Good morning
 
@Almo way to go :P
 
does anyone know about texturing a cube made out of 6 GL_QUADS / GL_POLYGON? (JOGL)
 
@Jeff <3
 
 
1 hour later…
5:34 PM
@Almo you're only allowed to hate on something if the bandwagon is heavy enough
there's too many C# users on SO
 
that's true
 
I've definitely seen the "Knock Knock" "who's there" <10 seconds later> "Java." multiple times though
 
hahahahah
that's a good one
 
5:57 PM
:D
@Jimmy too many indeed
 
well, I can't complain. I'm one of them :P
 
there was a time when it was the go-to language for learning game development
that's probably the reason
if the go-to language was C++, there would be too many C++ users
not that I complain about that, most C++ users consider themselves experts in all of it
 
Yay! Pandemic comes out today! (Board Game - 2nd Edition - been out of print ever since I wanted to buy it)
 
:D
Yeah, they are improving the art and some other crap
Oh, and 2 new role cards
 
There's no such thing as a C++ expert
just gradual levels of less cluelessness
 
6:06 PM
2nd edition?
or you mean reprinting?
it's been reprinted quite a few times
oh looks like 2nd edition
new art
 
I think it's actually the second edition
 
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!
 
Incompatible with the first edition too
 
6:08 PM
Right. I believe they might have changed up some cities too or something
 
I have the last printing of the first edition
 
I have a Chinese print of the first edition, heh
It was like $15, how could I say no?
 
Luckily the cards were all in English and I could print some English rules
Man... me and my friends are starting to sink deep into the board game world. We're buying games faster than we can play them
 
careful about that :)
I'll let you guys know when my colonialism game is available on TheGameCrafter
 
6:17 PM
@Almo yeah... if we're not careful, we'll need a board game bunker
 
:)
 
@Almo neat website
 
So like.... you could make a game... and just buy one copy for yourself and leave it up for sale if you want? Thats fun :D
 
:)
that's exactly it
But my game is a pretty serious game. I worked on it for 1.5 years
it's tested and ready to go
 
Any java/opengl gurus here?
 
6:29 PM
Cool
 
Ive made a cube in immediate mode, but trying to recreate it as a vbo with a texture, but with no success
 
@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
 
Ninja'd
 
WaahaA
 
6:33 PM
I cant seem to find a straight forward example
 
does it texture in immediate mode?
you could try setting it up with glTexCoord before using the VBO
 
@Jimmy a lot of the tuts I've seen aren't so straight forward or are missing details
 
@Jimmy yeah but that doesn't stop people from thinking whatever they want
 
7:39 PM
Man... I need a new office chair
 
really worth forking over a lot of loot for a decent chair
I got an aeron chair, and i like it a lot
had to bring it to work actually because the boss bought shitty chairs
but he doesn't like French restaurants because they don't give you enough food for the price
 
I don't even know where to get a decent chair
 
I got mine from Costco
but continuing along our audio vein, I generally don't know "decent" from "good"
 
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
 
well the deal is I can tell between $10 and $100
I just can't tell anything above that
 
7:54 PM
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.
 
and then he takes his iPods out jogging in the city where ambient traffic noise drowns out the difference anyways ;)
 
hahah :)
 
01:00 - 20:0020:00 - 00:00

« first day (916 days earlier)      last day (4087 days later) »