519 reputation
27
bio website mathandcode.com/portfolio
location
age 20
visits member for 3 years, 1 month
seen yesterday

Sep
18
comment Why is the origin in computer graphics coordinates at the top left?
So the real answer is: "Monitors do it because CRTs do it because analog TV standards were defined that way maybe because that's similar to writing." (I don't like having to go to the comments to get the full story >.<)
Jun
24
comment How do you change movement to strafe
Hint: If the vector (lx,lz) points in the direction of the character, the vector (-lz,lx) points to the character's left.
Dec
20
comment Why not use vectors to represent orientation?
@slartibartfast I believe so, but there's a difference between "Add these two 3D angular velocities" and "rotate by this angular velocity for A seconds and then rotate by this angular velocity for B seconds".
Oct
16
comment The physics equation for a perpetual seesaw
@teodron I made it nicer, let me know. No shorter, but I did delete some paragraphs and format it. I don't see how energy/force equations would make things nicer here: as I see it to use more force things you'd need a bunch of collision detection and conditional statements, and to use energy equations you'd need to do the same thing as above, while making up values for energy loss and dealing with qdt squared instead of just qdt.
Aug
16
comment Can I simplify the inequality “distance(p1, p2) < distance(p1, p3)?”
@SamHocevar Sure, I agree, but what does that have to do with points and vectors? ;)
Aug
15
comment Can I simplify the inequality “distance(p1, p2) < distance(p1, p3)?”
You have four additions, so 4*dimension additions total. I'm not sure what's better: d more multiplications or 2*d more additions? I think this is an unsatisfactory answer; what Byte56 did is straightforward, and this doesn't even leave me convinced that it's any faster! (Also, if we don't care about the distinction between affine spaces and vector spaces, insisting that vectors and points are distinct only gets in the way of understanding. Personal opinion/peeve.)
Feb
9
comment Optimizing gravity calculations
And I should add: I don't have the source code. If you're looking for some source code check out part-nd (written in c). I'm sure there are others out there, too.
Feb
9
comment Optimizing gravity calculations
Fixed! sorry, forgot to pay the rent on that domain, and someone auto-bought it :\ Also, 3 mins is a pretty good response time on a 1.3 year old post 8D
Apr
13
comment Is knowing physics necessary for game development?
world coordinate to screen coordinate transformations, composition of matrices so that objects can be fixed relative to each other (limbs). Really anything to do with translating, scaling, or rotating objects (especially doing all three at once). Besides affine linear algebra, there's also dot product, useful for anything "in the direction of" anything else (shooting, turning, pointing). Linear algebra is also what turns a 3d object into a 2d point on your screen (1 matrix+1 division=point on screen!)
Apr
11
comment Is knowing physics necessary for game development?
+1 for vectors. Linear algebra and affine transformations are extremely useful for simplifying equations.
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
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
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
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
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