Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Is there is a Node to rotate the model

Hi I was wondering if it’s possible
use some nodes to make the model rotate around the axis?
I tried the (rotate about axis) with (time) and (vector 3) but with no luck.

Comments

  • dave1707dave1707 Mod
    Posts: 9,248

    What model are you trying to rotate

  • dave1707dave1707 Mod
    Posts: 9,248

    Here’s an example to rotate a model.

    function setup()
        parameter.number("RotateX", 0, 360,0)
        parameter.number("RotateY", 0, 360,180)
        parameter.number("RotateZ", 0, 360,0)
    
        scene = craft.scene()
        scene.camera.position=vec3(5,10,-50)  
    
        ch=scene:entity()
        ch.model=craft.model(asset.builtin.Blocky_Characters.Robot)
    end
    
    function update(dt)
        ch.eulerAngles=vec3(RotateX, RotateY, RotateZ)
        scene:update(dt)
    end
    
    function draw()
        update(DeltaTime)
        scene:draw()       
    end
    
  • Posts: 1,045

    my codea craft series takes you through my thinking and learning about rotating things. you might take a look. here's one: https://ronjeffries.com/articles/020-codea/craft-5/

  • Posts: 5

    Thanks guys for your quick response
    But I’m sorry I wasn’t Clear
    I’m using shade app not Codea
    I was trying to rotate the preview model using nodes.

Sign In or Register to comment.