Converting Polar coordinates in Euler Angles

Imagine you have scene, sun arising.

In center we have a rotation point ($PointRotate01) with [0,0,0] coordinate, and light ($Omni01) with [50,0,0] coordinate.

And $Omni01.parent = $PointRotate01

The light roll about world center, like the sun.

As issue we have array ARISE ANGLES.
arrayArise=#(0,1,2,…… 90)

I want make animation sun arising, use only ARISE ANGLES. In 0 frame, I have 0 degrees arise angel,
in 1 frame I have 1 degrees arise angel, ….., and so on.

I tray use Euler Angles.
--------------------------------------------------------------
for t=0 to animationRange.end do
(
sliderTime=t
at time t
rot_sun=eulerangles 0 t 0
animate on
(
rotate $Point01 rot_sun
)
)
--------------------------------------------------------------
Or
-------------------------------------------------------------
for t=0 to animationRange.end do
(
sliderTime=t
at time t
default=eulerangles 0 0 0
rot_sun=eulerangles 0 t 0
animate on
(
rotate $Point01 default
rotate $Point01 rot_sun
)
)
--------------------------------------------------------------
…. And getting strange result.

Help me ……

Comments

Comment viewing options

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

how about this

delete objects
prt = Point name:"PointRotate" axistripod:on cross:off size:10
lght = Omnilight name:"Sun" pos:[50,0,0] parent:prt
prt[3][2][2].track = float_script ()
prt[3][2][2].track.script = "-(degtorad F)"
max time play

barigazy

Any's picture

One more question

If I have rotation point prt on X and Z axis simultaneously, how will bee find next part your script?

prt[3][2][2].track = float_script ()
prt[3][2][2].track.script = "-(degtorad F)"

barigazy's picture

reference in mxs help

http://docs.autodesk.com/3DSMAX/15/ENU/3ds-Max-Help/index.html?url=files...

"prt[3][2][2].track" is the shorter version of "prt.rotation.controller.Y_Rotation.controller"

barigazy

barigazy's picture

:)

It's simple just use instanced float script in both Y and Z track ei.controller

delete objects
prt = Point name:"PointRotate" axistripod:on cross:off size:10
lght = Omnilight name:"Sun" pos:[50,0,0] parent:prt
prt[3][2][2].track = prt[3][2][3].track = float_script ()
-- now both track use same float script and you need to assigne expression in one controller
prt[3][2][2].track.script = "-(degtorad F)"
max time play

barigazy

Any's picture

Barigazy, glad to listen you

Can you explain me
'prt[3][2][2].track = float_script ()'
expression?

Is this prt[3][2][2].track some matrix?

Send me referense on MaxScript Help topic, one more time, please...
Andrey

Any's picture

One more....

Your variant is good when FRAME in animation = Degree
If I have the angels array AngelsArray=#(15, 26, 35, 15.7,....60) and in ferst key of animation, rotation must be AngelsArray[1], in
second key AngelsArray[2], and so on?????????

barigazy's picture

...

are you need method with script controller or method with animation keys?

barigazy

barigazy's picture

method with animation keys

delete objects
angleArr = #(15,20,5,18,23,56,78,90,65,32,11,41)
prt = Point name:"PointRotate" axistripod:on cross:off size:10
lght = Omnilight name:"Sun" pos:[50,0,0] parent:prt
for t = 0 to angleArr.count-1 do
(
	with animate on at time t
	(
                -- rotate about Y axis
		prt[3][2][2].value = angleArr[t+1]
	)
)

barigazy

Any's picture

Barigazy, You ara RIGHT again.

Thak you vary mutch....

Comment viewing options

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