0 Replies Latest reply on Nov 24, 2006 2:55 AM by christian_cruz

    Spining a  model on a touchscreen

    christian_cruz
      Hello I have another question related to 3D.

      I made a little modification to the behavior automatic model rotation, I added this block:(default rotation speed 0(pSpeed))

      -- CONTROL ROTATION ----------------- <<<<<<<<<<<<<
      on mouseUp me

      if _mouse.mouseLoc > _mouse.clickLoc then
      testTest = pSpeed - 1
      pSpeed = testTest - 1
      else

      testTest = pSpeed + 1
      pSpeed = testTest + 1

      end if

      Also added a property called testTest. On the stage I have a 3d Member which contains a simple box :

      beginSprite me
      sprite(me.spriteNum).member.resetWorld()

      -- create the model resource
      myModelResource = sprite(me.spriteNum).member.newModelResource("My Box Resource",#box)
      myModelResource.height = 10
      myModelResource.width = 20
      myModelResource.length = 100

      -- create the model
      myModel = sprite(me.spriteNum).member.newModel("My Box",myModelResource)

      -- rotate to see it better
      sprite(me.spriteNum).member.model("My Box").rotate(45,45,0)
      end


      The short block that I added to the [automatic model rotation] sets the deafult speed to 0, then everytime I touch the screen and move from left to right or right to left the 3d model spins following the direction. This works well, BUT only on the lower half, if I do the same thing on the upper half, the resulting movement is the opposite. I've been trying to solve this, and I guess it must me simple, but I cannot figure it out.

      Any comments? ... please.