Advertisement Jump to content
  • Advertisement

MstWntd

Member
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

118 Neutral

About MstWntd

  • Rank
    Member
  1. MstWntd

    3D Collision Detection

    hey, sorry for my last post, i think this collision dection has me wacked out! this is my collision detection code, if (((mPosition - o->GetPosition()).Length() <= (o->size + size)) ) { Arrow * a = (Arrow*)o; a->setInFlight(false); OnCollision(o); return true; } return false; the pointer o is the arrow object. I dont really have any problem keepin the arrow stuck in the barrel,this i basically, i set the inFlight of the arrow to false, this stops the Physics Method from makin changes to the X and Y of the arrow. and then in the barrel class i render all the arrows in the barrel (kept in its own vector), before that i change the Z of each of the arrows to that of the barrel so it moves left and right with the barrel (my barrel is a moving target)
  2. MstWntd

    3D Collision Detection

    Come on, did i say some thing wrong in my post?
  3. MstWntd

    3D Collision Detection

    ------------------------- I have an Arrow which hits a barrel and is then stuck in the barrel The barrel is positioned as x=300, y=0 and z=0. but the problem is that in WHATEVER DIRECTION the arrow is shot in, if its x is around 300 and its y and z are around the y and z of the barrel, it will detect it as a collision. Also if i shoot the arrow well above the barrel, it will be detected as a collision. it might be worth noticing that all of my game objects are on different matrix (each one pops and pushes for its own rendering)..but i dont know enough to know if that makes a difference. I can post some source code, but that will have to be done when I get home. Thank you. --------------------------- Can someone please guide me in the right direction?..I am decent at programing, even in C++ but I am totally new to OpenGL. And I have to hand this work in really soon. Please!
  4. Sorry just realised, I posted my thread in the wrong session. And I cant seem to delete it! It should have be here, anyway http://www.gamedev.net/community/forums/topic.asp?topic_id=517296 can anyone help?
  5. I have an Arrow which hits a barrel and is then stuck in the barrel The barrel is positioned as x=300, y=0 and z=0. but the problem is that in WHATEVER DIRECTION the arrow is shot in, if its x is around 300 and its y and z are around the y and z of the barrel, it will detect it as a collision. Also if i shoot the arrow well above the barrel, it will be detected as a collision. it might be worth noticing that all of my game objects are on different matrix (each one pops and pushes for its own rendering)..but i dont know enough to know if that makes a difference. I can post some source code, but that will have to be done when I get home. Thank you.
  6. MstWntd

    Computing Direction Vector in 3D

    Someone? im really short on time and this is seriously killing me!
  7. MstWntd

    Motion Blur

    Does anyone have any code examples for motion blur that doesnt use glAccum? Iam trying to create a full sceene motion blur that doesnt grind my frame rates into the ground.
  8. MstWntd

    Computing Direction Vector in 3D

    Oh btw, a friend of mine told me I would need to point the cam in the DIRECTION of the Arrow, for this I would need a direction vector on each of my objects. which is why im askin how to calculate a direction vector. Also exactly which part of my cam would i insert the directions in? :-$
  9. Hi All, I'm making a 3D game in which when the Arrow is fired, the Camera will follow the Arrow. (note, mPosition is the 3D vector containing the position of the arrow) mCam->PositionCamera(mPosition.x-9,mPosition.y+2,0,mPosition.x+10,mPosition.y,mPosition.z,0,1,0); The above line of code works but only if the Arrow is kept in its initial position (this is when the cam and arrow share the same X position). If the Arrow is pointed in a different direction, the cam will move but along its own x, y and z. Any help will be greatly appreciated. Thanks.
  10. MstWntd

    3D Collision Detection OpenGL

    Thanks! ok so from that sample I have made this float min[3]; float max[3]; for (i = 0; i < numOfVerts; i++) { ...if ( V.x < min.x ) min.x = V.x; ...if ( V.y < min.y ) min.y = V.y; ...if ( V.z < min.z ) min.z = V.z; ...if ( V.x > max.x ) max.x = V.x; ...if ( V.y > max.y ) max.y = V.y; ...if ( V.z > max.z ) max.z = V.z; } Ok firstly, im soo embarrassed/sorry for dragging this on for so long! but if its possible, can someone look at the above screenshot? i have highlighted from where im going to read the verts of the object..I would just REALLY like to confirm that i am readin from the right place the screen shot shows the entire hierarchy of the model/mesh holder. thank you all again
  11. MstWntd

    3D Collision Detection OpenGL

    ah thanks! one more thing (hopefully its the last one!!) how do i find the minimum and maximum coordinates for each axis among all the vertices? Im going to be awake two days to get this finished..its due in on Friday.. :-C
  12. Hi, I want to do something like aabb. I am very new to this, I have my objects being rendered, moving and all Now I need collision detection. I have done some research and I have some code which calculates the new min and max and which checks for intersection..so this is what I have come up with 1)make a struct for a bounding box (bb) **giv it a vector3 called max and another called min 2)put this bb in my GameObject class 3)make a method in the GameOject class called "bool hasCollieded(BoundingBox * bb)" 4) now where do i check for collision? postRender?..preRender?.. OK, here is what i dont get, at some point im going to have recalculate the min and max..when do i do this?.. I need to get this work in on Friday, any quick help would be greatly appricated
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!