flex4 - flex, 3d object translation and rotation -


I would go to Flex with an independent (rotated) object as an independent supervisor in the form of X, Y, or Z . The relative movement of x, y works fine, but when I go with the z axis, the supervisor behaves because it is in addition to the exhaust system of objects and in the diagonal, for example, but not directly in the object .

A screenshot can be found here

  var dx1: number = mathematics (current ZRotation) * xDiff; Var dy1: number = -Math (Dzetrad (current resolution) * xdf; Var dy2: number = mathakos (dzetrad (current composition)) * yDiff; Var dx2: number = mathematics sin (digestrade) * yDiff; XDiff = DX1 + DX2; YDiff = dy1 + dy2; Var xyx: number = mathematics (current YRotation) * xDiff; Var aux: number = monastery sin (current YRotation) * xDiff; Var xxy: numeral = math sin (degToRad (current XRotation)) * aux; Var xxz: number = mathakos (current xrotation) * aux; Var yxz: number = -Math.sin (degToRad (current XRotation)) * yDiff; Var yxy: number = mathematics (Digitored current) * yDiff; Var zyz: number = 0; Var zxy: number = 0; Var xyx: number = 0; Zxy = Icon (mathematics. Because (degToRad (currentYRotation)) * Math (degToRad (currentXRotation)) * zDiff; Aux = mathematics. (DegToRad (currentXRotation)) * zDiff; Zyx = -sign (because degToRad (currentXRotation)) * mathematics (currentYRotation) * aux; Zyz = mathematics. (DegToRad (currentYRotation)) * aux; CurrentX + = xyx + zyx; Current Y + = yxy + zxy + xxy; CurrentZ + = zyz + xxz + yxz;    

Wait, are you implementing your original 3D engine? Why are not one of the many open source options being used which already does all these things? Like, (my personal fav) or

Besides, seeing your code only, I can say that you are making a lot of problem. If I were you, then I go with the degree calculations (trusting me on it) and look at the vectors and look like a matrix like Rob mentioned. It can also be on your head (Ficix is ​​hard: P), so my recommendation is using the predicted 3D engine.

Comments