510 reputation
26
bio website mathandcode.com/portfolio
location
age 20
visits member for 2 years, 9 months
seen yesterday

Apr
5
comment How do I find the angle required to point to another object?
Sorry to burst your bubble, but this method is 100% equivalent in theory to his method IF you subtract the camera's angle from his result.mathbin.net/91914
Apr
5
comment How do I find the angle required to point to another object?
You'd have to use the actual value of the cross product, because the length of a vector can't be negative (so if sin(theta) is negative the equation breaks down). Since A and B are on the same 2d plane, AxB has a Z component but an X and Y component of zero. So the Z component is sin(theta) WITH the sign. No length-taking necessary.
Apr
5
comment How do I find the angle required to point to another object?
The atan2 method definitely should work. Two things that throw me off: One, if you're in 3D space I'm guessing Z is the up axis? Just making sure you didn't mean to write location.z and location.x. Two, shouldn't you subtract the camera's angle from the returned angle? Also, if you're coordinate system in the point() function has (0,0) as the top left pixel of the screen, you should negate the y value cosine term, so you'd have 160-60*cos(angle). This is because angle=0 should be at the top of the circle, eg the highest point on the circle, 160-60.
Mar
29
answered How to render 2D particles as fluid?
Mar
17
comment Transform coordinates from 3d to 2d without matrix or built in methods
Woah, that's a good looking post now. Thanks Aku.
Mar
17
awarded  Commentator
Mar
17
comment Collision within a poly
The linear algebra used in that post would probably only be covered in a week or two. Just google "vector cross product".
Mar
14
answered Transform coordinates from 3d to 2d without matrix or built in methods
Mar
14
comment Transform coordinates from 3d to 2d without matrix or built in methods
You can calculate everything using matrices by hand or with a computer algebra system, and just plug those in.
Mar
13
comment improving speed of 2d ball collision
Some more implementation details would be helpful. How do you add the balls to the grid? Do you go for(x=0 to gridnum,y=0 to gridnum) if (ballIsInGrid(x,y)) addBallToGrid()? With a naive method like that speed would suffer. How many squares do you have? I know someone that did the exact same thing you're doing but with 10,000 particles or so, and it could run in real time, so i dont think your problem is with the theory.
Mar
9
comment Matrix for 2D perspective
ack, sorry, I misread.
Mar
8
comment Matrix for 2D perspective
Yes, do it in 3d. Also: Why would you want to do it without a matrix? A matrix simplifies the math! Edit: I should make it clear that a lot of the time I don't actually use an actual matrix, they're just the theoretical tool I use. With 2D stuff it's usually just x=Ax+By+C, y=Dx+Ey+F
Mar
5
answered Calculate impulse need on object to throw i Y meters into the air, with varying mass
Feb
27
awarded  Supporter
Feb
19
comment SFML Segmentation Fault when using VBOs?
Do you mean "even if I try to draw three vertices it segfaults"? Triangles have three vertices :P
Feb
19
comment SFML Segmentation Fault when using VBOs?
Is it because you're trying to draw a triangle with two vertices?
Feb
11
comment How do you generate tileable Perlin noise?
you can really just modulo the position, but I love all the awesome/creative answers to this question. So many different ways to do the same thing.
Feb
11
comment Calculate vector in local space
cos^-1 only has a range from 0 to Pi. You want Atan2/atanfull
Feb
10
awarded  Editor
Feb
10
revised Calculate vector in local space
added 143 characters in body