Search Results

Search found 5 results on 1 pages for 'spartan2417'.

Page 1/1 | 1 

  • Calculating the position of an object with regards to current position using OpenGL like matrices

    - by spartan2417
    i have a 1st person camera that collides with walls, i also have a small sphere in front of my camera denoted by the camera position plus the distance ahead. I cannot get the postion of the sphere but i have the position of my camera. e.g. i need to find the position of the point or at the very least find away of calculating the position using the camera positions. code: static Float P_z = 0; P_z = -15; PushMatrix(); LoadMatrix(&Inv); Material(SCEGU_AMBIENT, 0x00000066); TranslateXYZ(0,0,P_z); ScaleXYZ(0.1f,0.1f,0.1f); pointer.Render(); PopMatrix(); where Inv is the camera positions (Inv.w.x,Inv.w.z), pointer is the sphere.

    Read the article

  • forward motion car physics - gradual slow

    - by spartan2417
    Im having trouble creating realistic car movements in xna 4. Right now i have a car going forward and hitting a terminal velocity which is fine but when i release the up key i need to the car to slow down gradually and then come to a stop. Im pretty sure this is easy code but i cant seem to get it to work the code - update if (Keyboard.GetState().IsKeyDown(Keys.Up)) { double elapsedTime = gameTime.ElapsedGameTime.Milliseconds; CalcTotalForce(); Acceleration = Vector2.Divide(CalcTotalForce(), MASS); Velocity = Vector2.Add(Velocity, Vector2.Multiply(Acceleration, (float)(elapsedTime))); Position = Vector2.Add(Position, Vector2.Multiply(Velocity, (float)(elapsedTime))); } added functions public Vector2 CalcTraction() { //Traction force = vector direction * engine force return Vector2.Multiply(forwardDirection, ENGINE_FORCE); } public Vector2 CalcDrag() { //Drag force = constdrag * velocity * speed return Vector2.Multiply(Vector2.Multiply(Velocity, DRAG_CONST), Velocity.Y); } public Vector2 CalcRoll() { //roll force = const roll * velocity return Vector2.Multiply(Velocity, ROLL_CONST); } public Vector2 CalcTotalForce() { //total force = traction + (-drag) + (-rolling) return Vector2.Add(CalcTraction(), Vector2.Add(-CalcDrag(), -CalcRoll())); } anyone have any ideas?

    Read the article

  • exporting a maya model to work with Playstation mobile Studio?

    - by spartan2417
    Ive just started to program in Playstation Mobile Studio for the PS vita. The Models that are available to use in Ps Development have to .mdk models. The studio comes with a a model converter that converts from DAE, FBX, XSI and X files. However ive tried converting a maya scene to both DAE and FBX files but the converter returns an error with no explanation. Ive even tried to use blender and the tutorial here: http://www.gamefromscratch.com/post/2012/04/30/Exporting-from-Blender-to-PS-Suite-Blender-to-Vita-in-under-5-minutes.aspx but this fails at the converter too. With regards to maya all i do is export the file with default settings. Anyone know any good tutorials on this or guess why this would be happening?

    Read the article

  • Normalizing the direction to check if able to move

    - by spartan2417
    i have a a room with 4 walls along the x and z axis respectively. My player who is in first person (therefore the camera) should have collision detection with these walls. I'm relatively new to this so please bare with me. I believe the way to do this is to calculate the direction and distance to the wall from the camera and then normalize the directions. However i can only get this far before i dont know what to do. I think you should work out the angle and direction your facing? where _dx and _dz is the small buffer in front of the camera. float CalcDirection(float Cam_x, float Cam_z, float Wall_x, float Wall_z) { //Calculate direction and distance to obstacle. float ob_dirx = Cam_x + _dx - Wall_x; float ob_dirz = Cam_z + _dz - Wall_z; float ob_dist = sqrt(ob_dirx*ob_dirx + ob_dirz*ob_dirz); //Normalise directions float ob_norm = sqrt(ob_dirx*ob_dirx + ob_dirz*ob_dirz); ob_dirx = (ob_dirx)/ob_norm; ob_dirz = (ob_dirz)/ob_norm; can anyone explain in laymen's terms how i work out the angle?

    Read the article

  • Programming for Digital frames

    - by spartan2417
    A project has recently come to my attention but i have no idea where to start or even if its possible. The idea revolves around programming a clock that is displayed inside a digital photo frame. The user would then be able to put different pictures corresponding to different times inside a usb pen for example, which would load as soon as you put the usb in. The project itself would be a really neat project - if it was just on a computer. I have no idea if what im talking about it even possible on a digital photo frame and if it is what language? Anyone who has any input at all would be great. My current idea is to maybe have a small device at the back, SSD, that runs the program through a screen, completely by passing standard digital photo frames, again though i dont know how to begin with this. And yes ive tried google (although it helps to know what to google).

    Read the article

1