-- [ Picked text/plain from multipart/alternative ] Try this pseudo code, I think it should work:
Vector vecDifference = vecPosition - vecAbsOrigin; QAngle angToTarget; VectorAngles( vecDifference, &angToTarget ); flYaw = angToTarget[YAW]; flPitch = angToTarget[PITCH]; SetPoseParameter ( "yaw" , flYaw ); SetPoseParameter ( "pitch" , flPitch ); ----- Original Message ----- From: "Adam Maras (memzero)" <[EMAIL PROTECTED]> To: "hlcoders" <[email protected]> Sent: Monday, January 21, 2008 7:27 PM Subject: [hlcoders] Vector math is simply beyond me. > Hello, everybody. I'm having a headache with a model entity I'm writing, > and I need your help. > > To start off, the entity is a turret. It has a model, the model has > pitch and yaw pose parameters I use to "point" the model at the player > it's shooting at. That being said, I can't get the math right for the > yaw to come out right at all. Here's what I have: > > * Vector vecAbsOrigin( GetAbsOrigin() ); // the absolute center of > the model > * QAngle angAbsAngles( GetAbsAngles() ); // the absolute angles of > the model > * Vector vecPosition; // the absolute position of what's being shot at > > I've tried everything I know, but I cannot put these three values > together in any way that will give me a pitch and yaw for my > SetPoseParameter calls that will result in this turret pointing at its > target. I'm not versed in vector math, which doesn't help either. Can > someone help me out? > > // Adam Maras (memzero) > > _______________________________________________ > 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

