# theJ89

Members

15

122 Neutral

• Rank
Member
1. ## AABB - Line Segment intersection test

I stumbled upon this ancient thread the other day looking for a solution to the same problem, and I've been reading through it and all the related materials that jyk had posted. It's been a great amount of help to me so far, but I'm having trouble understanding a few things. Looking on Wikipedia's page for the Seperating Axis Theorem, it mentions that this is an intersection test for convex polygons, but doesn't that imply that the two shapes must contain at least 3 vertices each? A line segment would only contain two vertices; is the line segment being treated like a collapsed triangle? Second, for the cross products I noticed you posted: boxExtents.Dot(abs(axis[sub]i[/sub])) I understand that (for the purposes of finding the box "radius") you are making the axis vector's components all positive, but wouldn't this result in an axis pointed in a different direction in some cases? I figured that you would have to change the sign of the x/y/z/ values of the box extents vector depending on what octant the axis vector was located in to get the "radius", but by making the axis vector all positive, and keeping the box extents vector constant, you're acheiving the same result with less work? Third, if this test was being performed in 2D (i.e. a 2D AABB and a 2D line segment) wouldn't you have to test the axis perpendicular to the line segment? Why does this not have to be done in 3D? Do the cross-products take the place of this test (since they're all perpendicular to the line segment)? Fourth, can you give an example of a line segment and AABB that only the cross product tests could detect a non-collision on? Thanks, theJ89 PS: jyk, if you're still around, you might want to change the metanet tutorial link: http://www.metanetsoftware.com/technique/tutorialA.html
2. ## Swapping between 2D and 3D drawing modes

Hello again, GameDev. Here's a bit of background behind what I'm trying to accomplish: After rendering my 3D game world I want to render a simple 2D HUD on top of that. To start, I want to draw a simple, untextured solid triangle to the screen. The problem is I'm not really sure how to approach this. In the past, I've used an XYZ vertex format for 3D drawing and an XYZRHW vertex format for 2D drawing. Does this mean I'll have to swap between vertex formats to swap between 3D and 2D drawing? Or is it better to just set up the view/projection matrices in such a way to accomplish the same effect? Second issue, render states and matrices. Anything I should reset before swapping to 2D drawing? Any other pitfalls I should look out for? Thanks for your time, theJ89
3. ## Window using up 50% of my processor?

Thanks guys, I'll try them out and see what the results are. Edit: Doing sleep worked fine. Thanks for the help, guys! [Edited by - theJ89 on January 22, 2007 8:54:32 PM]

5. ## Help me with my application?

Oh! Yes, one last thing if you will. I am having trouble using diffusion to color my quads. For some reason, they become a jumble of red and black lines. For the time being, D3DFVF_DIFFUSE has been removed from the FVF. Do you know a possible solution for this?

7. ## Help me with my application?

Quote:Original post by Serapth You will probrably get alot more responses if you post the code in with your posts instead of getting people to download it. Just paste it into [ source ] and [ / source] blocks in your post ( loose the spaces though ). From your description, is there a reason you are using fixed sized arrays instead of Vectors? If not, without having read your code that would be my first suggestion. I will have more if you post the code in [smile] Thank you for the reply! I'll post the code in source tags now. I have been told Vectors are slow for fast access purposes, so I have been using arrays.
8. ## Help me with my application?

I've updated the first post to be more organized and detailed.

10. ## Need help with texturing quads

Well, I've completed the alpha bit. I just had to set a few things in the device when it initilized. But I am still having problems with D3DFVF_DIFFUSE. All but three lines of my code is exactly the same as above (only the createDevice function has changed). How do I use vertex color with textures?