   Change only one value of D3DXVECTOR3
  So I've got a sprite I'm trying to move around the screen with DirectX 9. I'm using direct input. In the struct for my sprite, I've got a member called "pos" for the position on the screen the sprite will be located. I want to use keyboard input to move the sprite by changing the value of pos. "pos" is a D3DXVECTOR3. How do I change just one argument in the D3DXVECTOR struct. I originally declared it as (200, 200.0f, 0.0f)?So my sprite structure is "spritex". I declared pos as:spritex.pos=D3DXVECTOR3(200,200.0f,0.0f);Later in the code for keyboard input:if(keystate[DIK_LEFT] & 0x80)spritex.pos += 1; //what do I put here?d3Sprite->Draw(d3Texture,&drawRect,NULL,&spritex.pos,0xFFFFFFFF);if(keystate[DIK_RIGHT] & 0x80)spritex.pos -= 1; //what do I put here?d3Sprite->Draw(d3Texture,&drawRect,NULL,&spritex.pos,0xFFFFFFFF);But obviously, this is wrong, because I want to change just the first value of the spritex.pos for DIK_LEFT and just the second value for spritex.pos for DIK_RIGHT.Thanks, I'm new to Directx programming.    
  D3DXVECTOR3 has 3 member variables, they are: x,y and z.so what you do is:if(keystate[DIK_LEFT] & 0x80)  spritex.pos.x += 1;also though, you only want to draw the sprite once, not twice.  Right?In the sample code below you are rendering twice.  This is probably more along the lines of what you want:if(keystate[DIK_LEFT] & 0x80)  spritex.pos.x += 1;if(keystate[DIK_RIGHT] & 0x80)  spritex.pos.x -= 1;d3Sprite->Draw(d3Texture,&drawRect,NULL,&spritex.pos,0xFFFFFFFF);Hope this helps!   ;  It worked, Atrix.  Thanks!   ;  An alternative would be:spritex.pos += D3DXVECTOR3(x,y,z) * scalar;Though you can still use .x and .y, you'll want to multiply in a scalar sooner or later, to account for time spent, seeing how it's impossible to predict how often your keyboard input function is being run. (provided you don't call it in very regular intervals, like a fixed fps)   