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.

Transformations not happening

5 posters

Go down

Transformations not happening Empty Transformations not happening

Post  bugman_2000 Fri Jun 12, 2009 8:38 pm

Hi,

I'm trying to get a character walking around basically, using the action animations from tut 15 and the simple transformations (rotation, translation) from tut 2. I've got the action animations working but for some reason I can't figure out how to get the object to respond to updated rotation and location values. The values are changing, but the character isn't moving.

Any ideas what I'm missing? Here's the templateScreenTouchMove function I'm using.

T


Code:

void templateScreenTouchMove( void *_ptr )
{
   SIO2object *frankie=  sio2ResourceGetObject( sio2->_SIO2resource,
                                    "object/frankie" );
   vec2 d0, d1;
   d0.x = sio2->_SIO2window->touch[0].x - start.x;
   d0.y = start.y - sio2->_SIO2window->touch[0].y;
   
   d1.x = sio2->_SIO2window->touch[1].x - start.x;
   d1.y = start.y - sio2->_SIO2window->touch[1].y;
   printf("d0.x = %f\n", d0.x);
   
   if( d0.x > 5.0f || d0.x < -5.0f )
   {
      sio2ObjectSetNextAction( frankie, "walk", 0.25f, 10.0f );
      
      frankie->_SIO2transform->rot->z += ( d0.x * 0.025f );
      frankie->_SIO2transform->loc->x += ( d0.x * 0.005);
      //printf("rotz %f\n", frankie->_SIO2transform->rot->z);
      sio2TransformBindMatrix( frankie->_SIO2transform );

   }   
}

bugman_2000

Posts : 14
Join date : 2009-04-30

Back to top Go down

Transformations not happening Empty Re: Transformations not happening

Post  sio2interactive Fri Jun 12, 2009 8:49 pm

You should use Bullet to control the player within the world... setLinearVelocity is probably what you are looking for...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Transformations not happening Empty Re: Transformations not happening

Post  bugman_2000 Fri Jun 12, 2009 9:46 pm

Thanks, I've got him moving around now.

bugman_2000

Posts : 14
Join date : 2009-04-30

Back to top Go down

Transformations not happening Empty Re: Transformations not happening

Post  _-MADMAN-_ Sat Jun 13, 2009 12:38 pm

Anyway, If You want to have full control and dynamic feeling - use forces. Especially, If Your player is/can use vehicle.

_-MADMAN-_

Posts : 52
Join date : 2009-04-23

Back to top Go down

Transformations not happening Empty Moving, but not correctly

Post  bugman_2000 Sun Jun 28, 2009 8:37 am

Hi,

Thanks for the replies previously. I got the character moving using forces. However, the linear velocity seems to be pushing him according to global coordinates... at least, the character rotating on its z axis has no effect on the linear velocity coordinates. For turning, I'm using setAngularVelocity, which makes him turn nicely in place, but it has no influence on the direction he moves.

In the tutorials such as tut 6 the camera moves using linear velocity and the rot->z value, but I haven't managed to figure out how to mimic that with this character. I've tried using rot and linear velocity but I can't get him to rotate this way.

Also, a little more explanation would be very welcome about *why* forces are better than location transforms, and more specifically why the transforms have no effect.

Thanks!

T

bugman_2000

Posts : 14
Join date : 2009-04-30

Back to top Go down

Transformations not happening Empty Hi

Post  narender.mudgal Sat Aug 08, 2009 1:31 pm

I am very new to sio2. I have been facing some problems and as I am new I am not able to understand
where to put my query. I want to ask you very simple thing. From some where i got some code
and i tried to modify the project so that i can learn and understand the changes. I have one cube and
one object on existing object . like in tutorial 3.
my_object = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource, SIO2_OBJECT, "object/pin" );
my problem is i dont know how to identify that object on touch. I tried with x,y position but if i move the
cube on x or y object than again pin object's x,y will change. i am working in objective c and there
on clicking i can identify the image like
[touch view] == img; thats it . please help me to know more.
I am very interested to learn 3D concepts.
one more thing I have on sio2 file, if i add that to tutorial 3 and change the name in existing project
it is not showing my object. is there any procedure for doing that.

Thanks a lot for reading this post.
Naren

narender.mudgal

Posts : 7
Join date : 2009-08-08

Back to top Go down

Transformations not happening Empty Forces to control vehicle object

Post  vikthered Sat Aug 08, 2009 3:00 pm

@Madman,

Can you please elaborate on using Forces to control a vehicle? I'm have a vehicle in third person cam mode and i'm trying to move it over a terrain with slopes/hills. I'm unable to adjust my vehicle's orientation whenever it goes upslope/downslope.



Thank you

vikthered

Posts : 25
Join date : 2009-06-25

Back to top Go down

Transformations not happening Empty Re: Transformations not happening

Post  sio2interactive Sat Aug 08, 2009 3:54 pm

Check the vehicle demo in the Bullet SDK...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Transformations not happening Empty Re: Transformations not happening

Post  vikthered Sat Aug 08, 2009 4:16 pm

Has anyone implemented the vehicle demo? Is it slow on a device?

vikthered

Posts : 25
Join date : 2009-06-25

Back to top Go down

Transformations not happening Empty Re: Transformations not happening

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


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