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.

Using sio2LookAt

2 posters

Go down

Using sio2LookAt Empty Using sio2LookAt

Post  teh1ghool Tue Oct 27, 2009 5:38 pm

I don't quite understand what it wants. It says (vec3, vec3, vec3). Which vectors do I put in it? I tried putting a vec3 in just the first. There are no good docs on how to use the functions...

teh1ghool

Posts : 5
Join date : 2009-10-27

Back to top Go down

Using sio2LookAt Empty Re: Using sio2LookAt

Post  ColorDelta Wed Oct 28, 2009 2:42 am

1) Vec3: Eye Position
2) Vec3: Target Position
3) Vec3: Up Vector (Typically 0, 0, 1)

Example:
Code:
vec3 targetPos;
vec3 upVector;

sio2LookAt(sio2->_SIO2camera->_SIO2transform->loc, &targetPos, &upVector);

ColorDelta

Posts : 16
Join date : 2009-03-25
Location : London, UK

Back to top Go down

Using sio2LookAt Empty Re: Using sio2LookAt

Post  teh1ghool Wed Oct 28, 2009 2:44 am

Thanks! I am going to add this as an entry to the wiki - The function isn't even on there.


-- Actually: What's the point of the vector if you provide the eye and target positions?

teh1ghool

Posts : 5
Join date : 2009-10-27

Back to top Go down

Using sio2LookAt Empty Re: Using sio2LookAt

Post  teh1ghool Wed Oct 28, 2009 8:00 pm

Using this function crashes the engine. Here's my code. Wow @ learning curves.

Code:

   // Look at Cube.
   SIO2object *_SIO2object = ( SIO2object * )sio2ResourceGetObject( sio2->_SIO2resource, "object/Cube" );
   vec3 targetPos;
   vec3 upVector;
   upVector.x = 0.0f;
   upVector.y = 0.0f;
   upVector.z = 1.0f;
   sio2LookAt(sio2->_SIO2camera->_SIO2transform->loc, _SIO2object->_SIO2transform->loc, &upVector);

teh1ghool

Posts : 5
Join date : 2009-10-27

Back to top Go down

Using sio2LookAt Empty Re: Using sio2LookAt

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