Rotate local xyz around global position (help)

Blitz3D Forums/Blitz3D Programming/Rotate local xyz around global position (help)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Oh, and you need to do the rotations in this order :-

z,x,y

	;rotate offset around Z axis
	newx# = x# * Cos#(zr#) - y# * Sin#(zr#)
	newy# = x# * Sin#(zr#) + y# * Cos#(zr#)
	x# = newx#
	y# = newy#
	
	;rotate offset around X axis
	newy# = y# * Cos#(xr#) - z# * Sin#(xr#)
	newz# = y# * Sin#(xr#) + z# * Cos#(xr#)
	y# = newy#
	z# = newz#


	;rotate offset around Y axis
	newx# = z# * Sin#(-yr#) + x# * Cos#(-yr#)
	newz# = z# * Cos#(-yr#) - x# * Sin#(-yr#)
	x# = newx#
	z# = newz#