Professional Web Applications Themes

A newbie's question, plz help!! - Macromedia Director 3D

i made my scene within Maya and exported it to director. now i want to control my camera movement . i used the following codes, however, doesn't work. i wonder what's wrong..... i guess one possiblity is my definition to the camera has been incorrect..... in the object inspector. my camera is defined both under the 'member' \+model"camera_see"\ and 'camera' \+camera("DefaultView")\ . i used the following code. ----------- property pLeftArrow, pRightArrow, pUpArrow, pDownArrow property p3Dmember property pSprite property pCamera property camSphereRes property pCameraSphere on beginSprite me --initiate the properties p3Dmember = sprite (me.spriteNum).member pSprite = sprite(me.spriteNum) pCamera = pSprite.camera pLeftArrow ...

  1. #1

    Default A newbie's question, plz help!!

    i made my scene within Maya and exported it to director. now i want to control
    my camera movement . i used the following codes, however, doesn't work. i
    wonder what's wrong..... i guess one possiblity is my definition to the camera
    has been incorrect.....

    in the object inspector. my camera is defined both under the 'member'
    \+model"camera_see"\ and 'camera' \+camera("DefaultView")\ . i used the
    following code.

    -----------

    property pLeftArrow, pRightArrow, pUpArrow, pDownArrow
    property p3Dmember
    property pSprite
    property pCamera
    property camSphereRes
    property pCameraSphere


    on beginSprite me

    --initiate the properties
    p3Dmember = sprite (me.spriteNum).member
    pSprite = sprite(me.spriteNum)
    pCamera = pSprite.camera


    pLeftArrow = false
    pRightArrow = false
    pUpArrow = false
    pDownArrow = false


    on keyDown
    case the keycode of
    123: pLeftArrow = true
    124: pRightArrow = true
    125:pDownArrow = true
    126:pUpArrow = true
    end case

    end

    on keyUp
    pLeftArrow = false
    pRightArrow = false
    pDownArrow = false
    pUpArrow = false

    end

    on controlCamera me
    if pLeftArrow then pCamera.rotate(0,-1,0)
    if pRightArrow then pCamera.rotate(0,1,0)
    if pDownArrow then pCamera.translate(0,0,3)
    if pUpArrow then pCamera.translate(0,0,-3)
    end

    ----
    i don't know if sprite(me,spriteNum) works fine here, coz my sprite name is
    "3dworld" ...... ha , i am a newbie here.....



    roger1980boy Guest

  2. #2

    Default Re: A newbie's question, plz help!!

    to controll the camera it is better to use "keypressed" than "on keydown"

    property pWorld
    property pMember
    property pCamera
    ...

    vec00=vector(0,0,0)

    if keypressed(123) then vec01=vector(0,-1,0)
    if keypressed(124) then vec02=vector(0,1,0)
    if keypressed(125) then vec03=vector(0,0,3)
    if keypressed(126) then vec04=vector(0,0,-3)

    transvec=vec00+vec01+vec02
    rotvec=vec00+vec03+vec04

    pCamera.rotate(rotvec)
    pCamera.translate(transvec)

    ...



    hondo3000 Guest

Similar Threads

  1. Newbie Question: Biz Card Template Question
    By Thomas_Porter@adobeforums.com in forum Adobe Indesign Windows
    Replies: 4
    Last Post: May 30th, 08:08 AM
  2. A newbie with a newbie question
    By dusty_davis@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 5
    Last Post: October 14th, 07:54 AM
  3. LOD newbie question
    By Dr Neil in forum Macromedia Director 3D
    Replies: 3
    Last Post: February 9th, 11:55 PM
  4. Pen Tool Use Question. (Embarrassingly Newbie Question)
    By Bozo Schmozo in forum Macromedia Flash
    Replies: 0
    Last Post: November 12th, 10:00 PM
  5. Newbie OO question
    By Michael Budash in forum PERL Miscellaneous
    Replies: 3
    Last Post: July 17th, 04:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139