# ravinDavin

Member

47

102 Neutral

• Rank
Member
1. ## Particle3D example msdn

Hi, can someone try to explain on me how is it that the "queue" system works in the microsoft example of particles? The english is confusing on me, sorry. Thanks.
2. ## Help with reflection Maths

Nvm, I forgot some basic vector math
3. ## Help with reflection Maths

That was great, I didn't even see the vector parallel to N, which was basically the most confusing part. Can you recommend any books on rendering algorithms/Maths that may have simple worked examples to illustrate equations and such? Are there any?
4. ## Help with reflection Maths

Hi, I attached a picture of something I got from a maths book. It is about calculating angle/direction of reflection. I cannot anywhere find actual worked examples using numbers on any type of math used in different rendering methods. Can someone explain to me why the distance bettween L and N is L-(N.L)N and linked to that, why is the vector N as (N.L)N? I have studied vector math and I understand the basics, but the way these books "explain" things is not helpful for me, I need to see things in action for understanding, any help is appreciated. Picture of my problem is attached http://i44.tinypic.com/i40dna.png
5. ## Collision Response

Don't really want to be doing 2 pixel tests per update though. And if I do that for a bounding box test it will not work for complex shapes. [/quote] If you are doing any sort of spatial hashing, then a bounding-box test, then pixel-level collision, I SERIOUSLY doubt you'd see a performance hit. If you're world (or level) isn't that large and/or you odn't have too many collideable objects, I bet you could even get by without spatial hashing. Years ago (2001), I wrote a space-shooter, and it did a bounding box test, then a pixel-perfect test (using load-time bit-masks from the sprites), and i never saw any performance hits. And, I was doing a lot of other stuff. AND, this was over 10 years ago. So, if you find a better method (which, using a 2d-physics library is a better method, see my sig for an example), go for it, otherwise, I'd bet you don't ave performance issues. [/quote] Ah thanks for the replies I'll have a go at it.
6. ## Collision Response

Don't really want to be doing 2 pixel tests per update though. And if I do that for a bounding box test it will not work for complex shapes.
7. ## Collision Response

Yes, Thats what I was attempting in the first place, But I cant seem to find a good way of determining if it was an X or Y collision. I tried determining it using the rectangle test before the pixel test etc. But it doesn't seem to work flawlessly. And I also was trying to think of a way to do it using the exact point of collision. I guess my main question is what is the best way of determining if its an X or Y collision
8. ## Collision Response

I'll give this one last bump too see if anyone can give me more advice.
9. ## What do programmers want/What motivates programmers?

Yeah man, chicks really dig computer geeks! LOL [/quote] Computer "literates", and yes, they do dig those
10. ## Collision Response

I don't see how that will work for me, Each update I implement gravity by increasing the yincrement over time. I need the Y to be set to 0 when a collision occurs, otherwise it will keep falling through the floor. But, I cant really just set y to 0 when I find a collision because then if the player collides with the side of a platform for example, he will stick to it. This is currently my update method of a base CollidableObject class: increment.y += gravity * acceleration * deltaTime check collision using projected matrix(based on x and y increments) if(no collision will occur) move it So what way will I structure it so I can use the oldPosition way to resolve collisions, so the gravity stops incrementing when I am on a platform?

Any tips?
12. ## Collision Response

Hi, Again I am on collisions. Ok, so this is what I want to do: If a collision occurs at the bottom of my player, I want to stop the Y increment. If a collision occurs at either side of my player, I want to stop the X increment. I have the code in place which will return a vector of the position at which a pixel collides. I have been trying for quite a while now to do this seemingly simple task. I have access to the point of collision, and both colliding objects' position and size. I should point out, that the resulting vector for the collision point is based on a projected matrix which tests for pixel collision. I have tried nearly every variation that comes to me. Making sure the players Xbounds are outside the other objects, meaning a side collision had occured. Making sure the players Xbounds were in the same range as the objects, and that its Yvalue was less(Top collision) I tried numerous ways with the collision point. Tried to code it to find out if the point of collision was at the bottom/top/left/right of the player (this is what I want to achieve, it seems the best approach) But everything I have done just seemed to fail, It would work on top,bottom and 1 side. It would work on both sides,bottom and not top etc. Any help appreciated.
13. ## Collision hiccups

Hi thanks for reply. I am going to take out your point about rounding errors , it seems most likely for me. Would normally be calculating a 2D position on screen using a float type or an int? Or it depends on how I check stuff like bounding boxes etc?
14. ## Collision hiccups

Hi, Just wondering if its normal for sometimes pixel perfect collision detection to make the player go a small bit into a platform. And if it is not, What do you think causes it? Too many collision checks/too fast movement etc? Or just bad collision detection?