[hlcoders] Rotation of an entity

2006-07-27 Thread Steve Rabouin
--
[ Picked text/plain from multipart/alternative ]
Hi,

I'm still learning through the SDK and I have this simple issue blocking me
into progress..

I'm simply trying to rotate the angles of an entity in relation to its
position. Changing its angles.y alone for example is not what I need. If the
entity is facing down, i need to change the angles based on its current
angles. If it was facing down, i'd probably need to change x, but if it was
in between, some of y and some of x would need to be changed, etc.. So I'm
thinking a function similar (if not) AngleVectors must be used, but I'm
unsure how..

Please help if you can

Thanks
--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Rotation of an entity

2006-07-27 Thread Garry Newman

Do you mean you want your entity to face the way it's travelling?


On 7/27/06, Steve Rabouin [EMAIL PROTECTED] wrote:

--
[ Picked text/plain from multipart/alternative ]
Hi,

I'm still learning through the SDK and I have this simple issue blocking me
into progress..

I'm simply trying to rotate the angles of an entity in relation to its
position. Changing its angles.y alone for example is not what I need. If the
entity is facing down, i need to change the angles based on its current
angles. If it was facing down, i'd probably need to change x, but if it was
in between, some of y and some of x would need to be changed, etc.. So I'm
thinking a function similar (if not) AngleVectors must be used, but I'm
unsure how..

Please help if you can

Thanks
--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Rotation of an entity

2006-07-27 Thread Steve Rabouin
--
[ Picked text/plain from multipart/alternative ]
No, I know I'm not making much sense, I can't really explain this properly..

Let's say I have a spray can, and i wanted it to rotate on its own. When
it's on a table, it would rotate with the y angles only. But if it fell on
the floor, it would now be facing the floor, and the x angles would need to
be changed to keep the same rotation going. What I am looking for, is how to
find the angles that I need to add to the current angles so that it will
rotate in that direction properly, whichever position it is facing. Does
that make more sense?

Thanks for trying to help :o

On 7/27/06, Garry Newman [EMAIL PROTECTED] wrote:

 Do you mean you want your entity to face the way it's travelling?


 On 7/27/06, Steve Rabouin [EMAIL PROTECTED] wrote:
  --
  [ Picked text/plain from multipart/alternative ]
  Hi,
 
  I'm still learning through the SDK and I have this simple issue blocking
 me
  into progress..
 
  I'm simply trying to rotate the angles of an entity in relation to its
  position. Changing its angles.y alone for example is not what I need. If
 the
  entity is facing down, i need to change the angles based on its current
  angles. If it was facing down, i'd probably need to change x, but if it
 was
  in between, some of y and some of x would need to be changed, etc.. So
 I'm
  thinking a function similar (if not) AngleVectors must be used, but I'm
  unsure how..
 
  Please help if you can
 
  Thanks
  --
 

--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Rotation of an entity

2006-07-27 Thread Garry Newman

Yeah I know what you mean I think.. If you want to rotate it using
physics it's easier.. Kinda. Well probably harder if you haven't
looked into motion controllers.

When you apply a motion controller to the physics object you can
decide whether the forces are local or global. If you choose local and
apply torque to it it'll rotate around its own angles (not the
world)..

I'll be interested in hearing the real solution to this when you're
not using physics - I'm dumb when it comes to angles and matrices and
stuff.


On 7/27/06, Steve Rabouin [EMAIL PROTECTED] wrote:

--
[ Picked text/plain from multipart/alternative ]
No, I know I'm not making much sense, I can't really explain this properly..

Let's say I have a spray can, and i wanted it to rotate on its own. When
it's on a table, it would rotate with the y angles only. But if it fell on
the floor, it would now be facing the floor, and the x angles would need to
be changed to keep the same rotation going. What I am looking for, is how to
find the angles that I need to add to the current angles so that it will
rotate in that direction properly, whichever position it is facing. Does
that make more sense?

Thanks for trying to help :o

On 7/27/06, Garry Newman [EMAIL PROTECTED] wrote:

 Do you mean you want your entity to face the way it's travelling?


 On 7/27/06, Steve Rabouin [EMAIL PROTECTED] wrote:
  --
  [ Picked text/plain from multipart/alternative ]
  Hi,
 
  I'm still learning through the SDK and I have this simple issue blocking
 me
  into progress..
 
  I'm simply trying to rotate the angles of an entity in relation to its
  position. Changing its angles.y alone for example is not what I need. If
 the
  entity is facing down, i need to change the angles based on its current
  angles. If it was facing down, i'd probably need to change x, but if it
 was
  in between, some of y and some of x would need to be changed, etc.. So
 I'm
  thinking a function similar (if not) AngleVectors must be used, but I'm
  unsure how..
 
  Please help if you can
 
  Thanks
  --
 

--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Rotation of an entity

2006-07-27 Thread Steve Rabouin
--
[ Picked text/plain from multipart/alternative ]
I am totally with you. I am also lost on this one hehe.. I recently figured
out how to do tracelines properly so that should say a lot ;)

I'll take a different approach to my problem, maybe other people can
understand :o The physics will not work for my problem, as I'm not really
changing the physical angles of the entity, but it's eye angles.

So for example, I would like to rotate a player's view to the left, without
moving their model at all. If the player is facing straight ahead, this is
farily easy. But if the player is looking up/down, then I have no idea what
to do, as the angles are relative to the world..

There must be some transpose functions or something I'm missing.. Any help
would be greatly appreciated ;)

Thanks again.


On 7/27/06, Garry Newman [EMAIL PROTECTED] wrote:

 Yeah I know what you mean I think.. If you want to rotate it using
 physics it's easier.. Kinda. Well probably harder if you haven't
 looked into motion controllers.

 When you apply a motion controller to the physics object you can
 decide whether the forces are local or global. If you choose local and
 apply torque to it it'll rotate around its own angles (not the
 world)..

 I'll be interested in hearing the real solution to this when you're
 not using physics - I'm dumb when it comes to angles and matrices and
 stuff.


 On 7/27/06, Steve Rabouin [EMAIL PROTECTED] wrote:
  --
  [ Picked text/plain from multipart/alternative ]
  No, I know I'm not making much sense, I can't really explain this
 properly..
 
  Let's say I have a spray can, and i wanted it to rotate on its own. When
  it's on a table, it would rotate with the y angles only. But if it fell
 on
  the floor, it would now be facing the floor, and the x angles would need
 to
  be changed to keep the same rotation going. What I am looking for, is
 how to
  find the angles that I need to add to the current angles so that it will
  rotate in that direction properly, whichever position it is facing. Does
  that make more sense?
 
  Thanks for trying to help :o
 
  On 7/27/06, Garry Newman [EMAIL PROTECTED] wrote:
  
   Do you mean you want your entity to face the way it's travelling?
  
  
   On 7/27/06, Steve Rabouin [EMAIL PROTECTED] wrote:
--
[ Picked text/plain from multipart/alternative ]
Hi,
   
I'm still learning through the SDK and I have this simple issue
 blocking
   me
into progress..
   
I'm simply trying to rotate the angles of an entity in relation to
 its
position. Changing its angles.y alone for example is not what I
 need. If
   the
entity is facing down, i need to change the angles based on its
 current
angles. If it was facing down, i'd probably need to change x, but if
 it
   was
in between, some of y and some of x would need to be changed, etc..
 So
   I'm
thinking a function similar (if not) AngleVectors must be used, but
 I'm
unsure how..
   
Please help if you can
   
Thanks
--
   
  
  --
 
  ___
  To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders
 
 

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders


--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Rotation of an entity

2006-07-27 Thread John Sheu
For entity angles, I think you're looking for something along the lines of
GetAbsAngles()/SetAbsAngles().  Note that GetLocalAngles()/SetLocalAngles()
doesn't refer to the object's own frame of reference (which wouldn't make
sense), but to the moveparent's frame of reference (if the moveparent
exists).

For eye-angles stuff, you'll probably do something like creating a rotation
matrix and grabbing the entity's transformation matrix, then combining them
with ConcatTransforms().

-John Sheu

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Rotation of an entity

2006-07-27 Thread John Sheu
Oh, and if you're going to do large changes of angles, start thinking about
quaternions.

-John Sheu

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



RE: [hlcoders] Rotation of an entity

2006-07-27 Thread Jay Stelly
Since this is a common question, I decided to write up something which
will hopefully help:
http://developer.valvesoftware.com/wiki/Rotation_Tutorial



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Garry Newman
 Sent: Thursday, July 27, 2006 2:46 AM
 To: hlcoders@list.valvesoftware.com
 Subject: Re: [hlcoders] Rotation of an entity

 Yeah I know what you mean I think.. If you want to rotate it
 using physics it's easier.. Kinda. Well probably harder if
 you haven't looked into motion controllers.

 When you apply a motion controller to the physics object you
 can decide whether the forces are local or global. If you
 choose local and apply torque to it it'll rotate around its
 own angles (not the world)..

 I'll be interested in hearing the real solution to this when
 you're not using physics - I'm dumb when it comes to angles
 and matrices and stuff.


 On 7/27/06, Steve Rabouin [EMAIL PROTECTED] wrote:
  --
  [ Picked text/plain from multipart/alternative ] No, I know I'm not
  making much sense, I can't really explain this properly..
 
  Let's say I have a spray can, and i wanted it to rotate on its own.
  When it's on a table, it would rotate with the y angles
 only. But if
  it fell on the floor, it would now be facing the floor, and the x
  angles would need to be changed to keep the same rotation
 going. What
  I am looking for, is how to find the angles that I need to
 add to the
  current angles so that it will rotate in that direction properly,
  whichever position it is facing. Does that make more sense?
 
  Thanks for trying to help :o
 
  On 7/27/06, Garry Newman [EMAIL PROTECTED] wrote:
  
   Do you mean you want your entity to face the way it's travelling?
  
  
   On 7/27/06, Steve Rabouin [EMAIL PROTECTED] wrote:
--
[ Picked text/plain from multipart/alternative ] Hi,
   
I'm still learning through the SDK and I have this simple issue
blocking
   me
into progress..
   
I'm simply trying to rotate the angles of an entity in
 relation to
its position. Changing its angles.y alone for example
 is not what
I need. If
   the
entity is facing down, i need to change the angles based on its
current angles. If it was facing down, i'd probably
 need to change
x, but if it
   was
in between, some of y and some of x would need to be changed,
etc.. So
   I'm
thinking a function similar (if not) AngleVectors must be used,
but I'm unsure how..
   
Please help if you can
   
Thanks
--
   
  
  --
 
  ___
  To unsubscribe, edit your list preferences, or view the
 list archives, please visit:
  http://list.valvesoftware.com/mailman/listinfo/hlcoders
 
 

 ___
 To unsubscribe, edit your list preferences, or view the list
 archives, please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders




___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Re: [hlcoders] Rotation of an entity

2006-07-27 Thread Steve Rabouin
--
[ Picked text/plain from multipart/alternative ]
Thank you Jay, I appreciate this, as this is exactly what I was looking for!
Now I just got to make sense out of this :)

On 7/27/06, Jay Stelly [EMAIL PROTECTED] wrote:

 Since this is a common question, I decided to write up something which
 will hopefully help:
 http://developer.valvesoftware.com/wiki/Rotation_Tutorial

--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders