ScriptSpot

Forum topic · General Scripting

Rotating

By Shade926 · 2013-04-08

Description

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 (4)

br0t · 2013-04-08

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

Shade926 · 2013-04-10

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

on rotate_matrix pressed

MKlejnowski · 2013-04-10


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 · 2013-04-11

Seems to of worked...

Well i dont get any errors

Thanks