• 15
• 15
• 11
• 9
• 10

# D3DMatrix Help

This topic is 4394 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Does DirectX 9 have a Transform based on a sine wave? I have been looking through the SDK help but cannot see one. If not is there a simple way to make a transform using a sine wave? I am looking for a simple way just to move an object from one side of the screen to the other along a smooth sine wave path. Thanks for looking.

##### Share on other sites
You could do this using some simple math. Your world transformation matrix places the object in the world. It has position data that you can manipulate.
If you want to move your object along a sine wave you could easily do something like this
D3DXVECTOR3 position;//using some sine wave alorithm//i.e. y = sin(x)//you can easily use this algorithm to get x and y coordinates.D3DXMatrix matWorld;D3DXMATRIXTranslation(&matWorld, position.x, position.y, position.z);pDevice->SetTransform(D3DTS_WORLDMATRIX, &matWorld);//render your object here.

I hope this helps.
Take care.