Rotating cartesian for slides

53 views
Skip to first unread message

Illu

unread,
Apr 17, 2018, 6:23:43 AM4/17/18
to MathBox
Hi,
Rotating cartesian normally works fine for me. However, trying same with present and slide doesn't work. In the following code if I just do plain mathbox.cartesian and does not use any present or slide, it works fine. Please help me fixing this.

Thanks,
Naidu.

    var present =
      mathbox.present({
        index: 1
      });

    // With one 6-step slide
    var slide = present  
    .slide({
      steps: 6
    })

    slide.cartesian({      range: [[-20, 20], [0, 1], [-20, 20]],
    scale: [40, 1, 40]
    }, {
    rotation:(t)=>[0, t*0.1, 0]
    })
    .grid({width:5, axes: [1, 3]})
    .camera({
    lookAt: [0,0,0],
    position: [0,5,5],
    }, {
    //rotation:(t)=>[0, t*0.1, 0]
    })

Illu

unread,
Apr 19, 2018, 3:35:27 AM4/19/18
to MathBox
Fixed it by animation location of camera instead of rotation.
    slide.cartesian({      range: [[-20, 20], [0, 1], [-20, 20]],
    scale: [40, 1, 40]
    }, {
    })
    .grid({width:5, axes: [1, 3]})
    .camera({
    lookAt: [0,0,0],
    position: [0,5,5],
    }, {
    location:(t)=>[Math.sin(t), 1, Math.cos(t)]
    })
Reply all
Reply to author
Forward
0 new messages