I have:
self - (the player)
wep.targorigin - (the origin the weapon in the player's hand is moving toward)
wep is an attachment on the player, so it's origin is relative.
in order to find it's real origin in the world I do this:
---
ang = self.angles + vectoangles(wep.targorigin); // the angle in the world from the player origin to the weapon origin
ang_x = -ang_x; // negate the pitch
makevectors(ang); // get v_forward
wep_position = self.origin + v_forward*vlen(wep.targorigin); // the weapon origin in the world
---
now I have wep_position to base my next calculation from.
and also:
wep.targangles - (the angles the weapon is turning toward)
wep.damagepoint_ofs - (the offset of the weapon blade)

wep.damagepoint_ofs being shown here as '8.7 0.2 23.23'
so I do the following to find the position of the weapon blade:
---
ang = self.angles + wep.targangles + vectoangles(wep.damagepoint_ofs); // the angle in the world from the weapon position to the weapon blade
ang_x = -ang_x; // negate the pitch again
makevectors(ang); // get v_forward
swing_end = wep_position + v_forward*vlen(wep.damagepoint_ofs); // the position of the blade in the world
---
for some reason this doesn't work out. the position of the blade ends up being calculated way off. I can't figure out what I'm doing wrong or what I need to do to make this work.
I suspect that it has something to do with this line:
ang = self.angles + wep.targangles + vectoangles(wep.damagepoint_ofs);
pitch, yaw, and roll are all tilted in wep.targangles, but self.angles and vectoangles(wep.damagepoint_ofs) only have a pitch and a yaw...
any ideas?