"Local" Angles?

So vectors are nice in that you can have world vectors and local vectors to add on to world vectors.

Is there anyway to have such a system with angles?

For example, let’s say I have a prop rotated (50,20,10). Then, imagining a new plane was created on its normal face, it was then rotated (0,10,0), or ten degrees yaw. I don’t want it to rotate ten degrees yaw absolutely, i.e. relative to the world, but relative to the prop in its current state. Does that make sense, and if so, is it possible?

I’m going to guess that

are what you’re looking for?

Yeah, it’s entirely possible.

We are Air Jordan UGG Boots Jerseys and GHD online store,supply all cheap price products,Such as Uggs Classic Tall,Ugg Bailey Button,Air Jordan online store,Nike Air Jordan,NACC Jerseys,Cheap NFL Jerseys, Cheap NHL Jerseys, NBA Jerseys,Cheap cartier glasses,GHD, New styles and hot styles are active every day.We wholesale our products at very low price but with high quality.Our products are always very hot in USA,UK, Canada, Australia, etc., Many wholesalers, retailers, shop owner, online store owner, byers buy and resell our products.UGG Classic Tall Boots sale - we offer high quality discount UGG Classic Tall Boots at wholesale price,cheap UGG Classic Tall Boots,Free Shipping.


(User was permabanned for this post ("Spam bot" - SteveUK))

If you don’t want to get confused with vectors and angles, you can try using matrices. From what I’ve seen, they’re rather underestimated by most scripters here, although they are damn powerful if you use them wisely.

For instance:

[lua]local objMatrix = Matrix()
objMatrix:Translate(self:GetPos())
objMatrix:Rotate(self:GetAngles())

local transMatrix = Matrix()
transMatrix:Translate(Vector(0, 0, 50))
transMatrix:Rotate(Angle(0, 10, 0))

local resultMatrix = transMatrix * objMatrix
self.Plane:SetPos(resultMatrix:GetTranslation())
self.Plane:SetAngles(resultMatrix:GetAngle())[/lua]

This way, you can also combine several transformations. Just keep in mind that when doing A * B, you’re applying the transformation matrix A to the matrix B, so make sure they are always in that order.