Rotating

Hello

Im trying to rotate a matrix but it keeps coming back with errors:

local mymatrix = matrix3 1
spinner spn_spinnerx "X Amount"
spinner spn_spinnery "Y Amount"
spinner spn_spinnerz "Z Amount"
button rotate_matrix "Rotate Matrix"
on rotate_matrix pressed do
(
myrotateM = preRotate [spn_spinnerx.value, spn_spinnery.value, spn_spinnerz.value] -----Here i need help i think
mymatrix = mymatrix*myrotateM
format "mymatrix = %\n" mymatrix
)

This is within a rollout

Any ideas would be lovely

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
br0t's picture

first thing that comes to

first thing that comes to mind is you are using "prerotate" on a point3 value instead of a matrix3 value, which consists of 4 vectors, not 3. you need to convert your [spnx,spny,spnz] to a matrix3 somehow

Never get low & slow & out of ideas

Shade926's picture

Is there a rotate that has a

Is there a rotate that has a matrix3 value.. i dont have to use pre rotate just any rotate will do??

MKlejnowski's picture

on rotate_matrix pressed

on rotate_matrix pressed do
(
myrotateM = (eulerangles spn_spinnerx.value spn_spinnery.value spn_spinnerz.value) as matrix3
mymatrix = mymatrix*myrotateM
format "mymatrix = %\n" (mymatrix as string)
)

Does that work for you?

Shade926's picture

Seems to of worked... Well i

Seems to of worked...

Well i dont get any errors

Thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.