![]() |
| | #1 |
| Registered User Join Date: Nov 2002
Posts: 259
| Compute the angle to rotate for 2 vectors vectors are D3DXVECTOR3 TeaPotPos(0.0f,-3.0f,-10.0f); D3DXVECTOR3 TeaPotPos2(0.0f,3.0f,-10.0f); pic included http://img709.imageshack.us/img709/1994/helpk.jpg thanks for looking
__________________ |
| Anddos is offline | |
| | #2 |
| dat is, vast staat Join Date: Jul 2008 Location: SE Queens
Posts: 6,612
| Does directX not have a "rotate" function?
__________________ C programming resources: GNU C Function and Macro Index -- glibc reference manual The C Book -- nice online learner guide Current ISO draft standard CCAN -- new CPAN like open source library repository GDB tutorial #1 -- gnu debugger tutorials -- GDB tutorial #2 cpwiki -- our wiki on sourceforge |
| MK27 is offline | |
| | #3 |
| Registered User Join Date: Nov 2002
Posts: 259
| yes it does but i need to find the exact value which is a float to rotate
__________________ |
| Anddos is offline | |
| | #4 |
| Robot Join Date: Mar 2009
Posts: 372
| What exactly are you looking for? If you're simply looking for converting the angle from degrees to radian, then you probably already know that 180 degrees is equal to pi radians. Last edited by Memloop; 12-16-2009 at 04:08 PM. |
| Memloop is offline | |
| | #5 |
| Super Moderator Join Date: Aug 2001
Posts: 8,322
| Well there are a few ways I know of to do this. First, the hard way.
Now, the easy way:
For a simple top-down 2D rotation:
Note that this will cause the bottom teapot to 'snap' to the correct orientation. If you want a smooth transition you will need to lerp from it's current orientation to it's the orientation you just calculated.
__________________ I remember when The Weather Channel talked about weather, MTV played music videos, and the History Channel talked about history instead of conspiracy theories. Last edited by Bubba; 12-16-2009 at 11:44 PM. |
| Bubba is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Camera rotate to function | Bubba | Game Programming | 0 | 11-15-2008 12:22 PM |
| Vectors | naseerhaider | C++ Programming | 11 | 05-09-2008 08:21 AM |
| How properly get data out of vectors of templates? | 6tr6tr | C++ Programming | 4 | 04-15-2008 10:35 AM |
| HUGE fps jump | DavidP | Game Programming | 23 | 07-01-2004 10:36 AM |
| Points, vectors, matrices | subnet_rx | Game Programming | 17 | 01-11-2002 02:29 PM |