3 Replies Latest reply on Apr 30, 2007 2:58 AM by danieloizo

    camera rotation

    newmfa
      Hello,
      "camera rotation with a button"
      this what i aim, in dirMX04, i have a 3d scene includes one model named"box", i tried
      rotate camera around this box in horizental rotation, i used camPivot, but it may not good for my
      project, it cause the scene slow and require on every scene change pivot point vector, and other
      problem i want use 3d scene member name not sprite number

      my aim is"when click a button, the camera rotate around model "box" in w3d member named "w3d 1""
      is it possible with lingo..?

      regards
      newmfa
        • 1. Re: camera rotation
          danieloizo
          Hi,

          Yes it is possible, you need to add a behavior to the sprite (w3d 1) there you need to write some code, "

          global w3d1,box1,camera1

          on beginsprite me
          w3d1 = member("w3d 1")
          w3d1.resetworld()

          box1_r = w3d1.newmodelresource("box1_r",#box)
          box1 = w3d1.newmodel("box1",box1_r)

          camera1 = w3d1.camera(1)

          w3d1.newlight("l1",#ambient) -- makes a light

          end
          "
          now make a button , right click on the button and go on script , there you add this "
          global w3d1,box1,camera1
          on mouseUp me
          camera1.rotate(vector(0,5,0),box1)
          end
          "

          here i made an example for you :
          http://www.danieloizo.go.ro/rc.rar

          if you don't understand something, just ask.

          Daniel
          • 2. Re: camera rotation
            newmfa Level 1

            thanks for your genious..
            create box in center of the scene is good idea and solve my problem, is there way
            to hide this box or make it very small, it is very big and hide the important models in same scene..?
            i searched in lingo index reference and i can't find "Hide model script"..!

            newmfa
            • 3. Re: camera rotation
              danieloizo Level 1
              you can zoom out or you can hide the model:
              add another 2 buttons one zoom an one hide,
              on the zoom button add this code
              "
              global w3d1,camera1,box1

              on mouseUp me
              camera1.pointat(box1,vector(0,1,0))
              camera1.translate(0,0,100)
              end
              "
              and on the hide button ad :"
              global w3d1,box1,camera1

              on mouseUp me
              if box1.shader.blend = 100.0000 then
              box1.shader.blend = 0
              else
              box1.shader.blend = 100
              end if
              end
              "
              daniel