FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

move by direction

2 posters

Go down

move by direction Empty move by direction

Post  sakrist Sat May 30, 2009 7:38 am

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

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

http://www.developers-life.com

Back to top Go down

move by direction Empty Assuming...

Post  goldfrapp0x0309 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.
goldfrapp0x0309
goldfrapp0x0309

Posts : 43
Join date : 2009-02-28

Back to top Go down

move by direction Empty :!:

Post  sakrist 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
sakrist
sakrist

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

http://www.developers-life.com

Back to top Go down

move by direction Empty Re: move by direction

Post  sakrist 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

move by direction Img_0310

off top
sakrist
sakrist

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

http://www.developers-life.com

Back to top Go down

move by direction Empty Re: move by direction

Post  sakrist 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 );
sakrist
sakrist

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

http://www.developers-life.com

Back to top Go down

move by direction Empty Straight Forward Way...

Post  goldfrapp0x0309 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);
goldfrapp0x0309
goldfrapp0x0309

Posts : 43
Join date : 2009-02-28

Back to top Go down

move by direction Empty Re: move by direction

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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