move by direction

View previous topic View next topic Go down

move by direction

Post  sakrist on Sat May 30, 2009 7:38 am

how move object by direction
tutorial 09 please description about it
avatar
sakrist

Posts : 23
Join date : 2009-04-28
Age : 29

View user profile http://www.developers-life.com

Back to top Go down

Assuming...

Post  goldfrapp0x0309 on Sun May 31, 2009 12:03 am

Move object in direction of its directions.

transform->loc->x + transform->dir->x * t.

Where t is how much moving to do. Do same for y and z.
avatar
goldfrapp0x0309

Posts : 43
Join date : 2009-02-28

View user profile

Back to top Go down

:!:

Post  sakrist on Sun May 31, 2009 4:55 am

lol! lol! lol! lol! lol! lol! lol! lol!
off top


Last edited by sakrist on Sun May 31, 2009 5:01 am; edited 1 time in total
avatar
sakrist

Posts : 23
Join date : 2009-04-28
Age : 29

View user profile http://www.developers-life.com

Back to top Go down

Re: move by direction

Post  sakrist on Sun May 31, 2009 4:58 am

Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy



off top
avatar
sakrist

Posts : 23
Join date : 2009-04-28
Age : 29

View user profile http://www.developers-life.com

Back to top Go down

Re: move by direction

Post  sakrist on Sun May 31, 2009 4:56 pm

Goldfrapp wrote:Move object in direction of its directions.

transform->loc->x + transform->dir->x * t.

Where t is how much moving to do. Do same for y and z.


Thanks!!!!!

Earlier, I received an error, because I have not used the correct transform of object

my source
Code:

angelA = 90 * (
             sio2->_SIO2camera->_SIO2transform->dir->x);
   
   
   cath1 = cos( angelA/SIO2_RAD_TO_DEG )*c;
   cath2 = sqrtf(c*c - cath1*cath1);
   
   
   
   newobj->_SIO2transform->loc->z =  object->_SIO2transform->loc->z;
   newobj->_SIO2transform->loc->x =  object->_SIO2transform->loc->x;
   newobj->_SIO2transform->loc->y =  object->_SIO2transform->loc->y;

   if(sio2->_SIO2camera->_SIO2transform->dir->x > 0)
      newobj->_SIO2transform->loc->x += fabs( cath2 );
   if(sio2->_SIO2camera->_SIO2transform->dir->x < 0)
      newobj->_SIO2transform->loc->x -= fabs( cath2 );
   
   if(sio2->_SIO2camera->_SIO2transform->dir->y > 0)
      newobj->_SIO2transform->loc->y += fabs( cath1 );
   else if(sio2->_SIO2camera->_SIO2transform->dir->y < 0)
      newobj->_SIO2transform->loc->y -= fabs( cath1 );
avatar
sakrist

Posts : 23
Join date : 2009-04-28
Age : 29

View user profile http://www.developers-life.com

Back to top Go down

Straight Forward Way...

Post  goldfrapp0x0309 on Sun May 31, 2009 8:06 pm

This should do it:

sio2->_SIO2camera->_SIO2transform->loc->x += sio2->_SIO2camera->_SIO2transform->dir->x * (HowMuchUWantToMove);
sio2->_SIO2camera->_SIO2transform->loc->y += sio2->_SIO2camera->_SIO2transform->dir->y * (HowMuchUWantToMove);
sio2->_SIO2camera->_SIO2transform->loc->z += sio2->_SIO2camera->_SIO2transform->dir->z * (HowMuchUWantToMove);
avatar
goldfrapp0x0309

Posts : 43
Join date : 2009-02-28

View user profile

Back to top Go down

Re: move by direction

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum