14 Replies Latest reply on Mar 15, 2007 10:09 AM by danieloizo

    WASD Camera Navigation

    sponner
      It's killing me. I've got a 3D world I've created and successfully imported into Director. I'd like to use the simple navigation method used in games (the WASD to move and strafe, and use the mouse to look around). It'd also be nice to be able to use Shift to move the camera up and Cntrl to drop it down. I've been searching for days for a good script that would make this happen, and I just haven't been able to find one - although I've found games that use a similar structure.

      Does anyone know of such a script that I could use? It's making me loose the last bit of hair that I had.!

      Thanks.
        • 1. Re: WASD Camera Navigation
          Totherescue Level 1
          I'm 11 years old and I had a 3D envirerment and I made the guy able to move around it. I know how to add a gun and enimies but am having trouble with bounderies! I'll figure it out though a engine with Director is not to hard. In fact, the programming of a 3D game is a little easy with Director! Just modeling is hard. For me it is like that because I took lots of tutorials for beginners!
          • 2. Re: WASD Camera Navigation
            sponner Level 1
            So could you share the script you used to navigate through your scene?
            • 3. Re: WASD Camera Navigation
              johnAq Level 1
              I think the ChromeLib has behaviours that can acheive this, but not sure if you need the free or full version

              www.chromelib.com

              hth

              johnAq
              • 4. Re: WASD Camera Navigation
                Totherescue Level 1
                Its me to the rescue again. I am 11 years old and I know the script and how to add a gun and enemies but not one thing thats hard for me.... BOUNDARIES. Add the email musicfoolcrazy@hotmail.com if you wanna know how to navigate but plz.. How you make bounderies. I'll give you all the script and a tutorial if you add me but I really need help in thius case. I can add enemies and guns but no boundaries. How silly. In flash this function is called hitest when something hits another a certin action happens like someone hitting vertine ground a enemie would decect you act and it would bring a action or gun pickups and boundaries! How is this function done in Director mx 2004? I'm trying to make a 3D game by myself but I know the programming how to add a good cursor too but I need to know this. My father is doing the 3D modeling so I'm not modeling, only porgramming. I'm even expirenced in flash but I really don't want to let my Studio down so I have to make a game no matter what! I can make sound effects or get them but with grapics I'm a little bad. PLEASE HELP NE WITH BOUNDARIES IN DIRECTOR!
                • 5. Re: WASD Camera Navigation
                  danieloizo Level 1
                  Hi Totherescue,

                  here is a script that detects a collision between 2 objects and triggers a handler named doosomthing . (just add it to a blank shockwave 3d):
                  "
                  global obj
                  global s1,s2 -- sphere1 and sphere2

                  on beginsprite me
                  obj = sprite(me.spritenum).member
                  obj.resetworld()
                  sphere_r = obj.newmodelresource("sr",#sphere)
                  sphere_r.radius = 10
                  s1 = obj.newmodel("sphere1",sphere_r)
                  s2 = obj.newmodel("sphere2",sphere_r)
                  s2.translate(50,0,0)

                  s1.addmodifier(#collision)
                  s1.collision.resolve = 1
                  s1.collision.setcollisioncallback(#dosomething,me)

                  s2.addmodifier(#collision)
                  s1.collision.resolve = 1
                  end

                  on dosomething me, collisiondata
                  put collisionData.modelA
                  end

                  on exitframe
                  go the frame
                  s1.translate(1,0,0)
                  end
                  "
                  I hope it is what you have been searching for.
                  for more info, search for "collision" in director's documentation.

                  Daniel.
                  • 6. WASD Camera Navigation
                    danieloizo Level 1
                    Hi sponner,

                    here is a link to some cool tutorials, realy good for beginners:
                    you will find what you need there!
                    http://www.fbe.unsw.edu.au/Learning/Director/

                    Daniel.
                    • 7. Re: WASD Camera Navigation
                      Totherescue Level 1
                      NO no no no.... PLZ Just somebody give me a .dir file with bounderies by putting a link to it cuz I need to see a example and make it as simple as possible with W,A,S,D Navigating and I know how to do that. Also do that in simplest form possible! TY!!!!!
                      • 8. Re: WASD Camera Navigation
                        Totherescue Level 1
                        NO no no no.... PLZ Just somebody give me a .dir file with bounderies by putting a link to it cuz I need to see a example and make it as simple as possible with W,A,S,D Navigating and I know how to do that. Also do that in simplest form possible! TY!!!!!
                        • 9. Re: WASD Camera Navigation
                          sponner Level 1
                          Thanks for the leads everyone. JohnAQ: I tried the ChromeLIb and that looks close, but the rotation all seems to be rotating around the wrong axis. Do you have any words of wisdom on the First Person behavior?

                          DanielOzio: I've seen those tutorials, but they just seem to rotate around the character (and then swap cameras). Am I misreading that camera tutorial?
                          • 10. Re: WASD Camera Navigation
                            _lw Level 1
                            the collision modifier is a little bit tricky and i would not use it for a egoshooter like navigation. I would suggest using modelsunderray or havok to do the collision detection (havok can be confusing for people who just got into lingo...)

                            By the way, collision detection something very often discussed in this forum:
                            http://www.adobe.com/cfusion/webforums/forum/searchresults.cfm?FTVAR_TABLECHOICEFRM=archiv e&FTVAR_STARTDATEFRM=&FTVAR_SEARCHWHATFRM=c&FTVAR_KEYWORD1FRM=collision&FTVAR_ENDDATEFRM=& FTVAR_DATESELFRM=Select&FTVAR_CATEGORYIDFRM=268&FTVAR_AUTHORFRM=&FTVAR_RESULTTYPE=topics&S TARTPAGE=1&FTVAR_FORUMVIEWTMP=Linear
                            • 11. WASD Camera Navigation
                              danieloizo Level 1
                              Sponner,

                              Do you want to simply walk trough the world like in a FPS shooter?
                              like in this example ?

                              http://www.danieloizo.go.ro

                              Use forward, left, right, a , q to move and look
                              • 12. Re: WASD Camera Navigation
                                sponner Level 1
                                The link didn't work, would you mind reposting? I'd really like to see it.

                                Essenatilly, yeah, I want to walk through the world like in a FPS, but I'd also like the ability to fly straight up (like with the SHIFT) and straight down (like with the CNTRL) as you can do in something like UT2004.
                                • 13. Re: WASD Camera Navigation
                                  sponner Level 1
                                  OK....just for some interesting discoveries I've been making. My original attempts were using C4D, and apparently, the axis system is different. So all the outputs were really weird, and what should have been rotating one way was rotating the other. Very confusing.

                                  Experiments with Maya have been more trustworthy (although Maya 8.5 doesn't have a Shockwave exporter for some reason). I still haven't gotten a truly interactive navigation down yet. So I'd still like any help I can get, but things are making a little bit more sense to me now.
                                  • 14. Re: WASD Camera Navigation
                                    danieloizo Level 1
                                    Some friends of mine tried the link and it worked, i tried to and it works, please try again and if it still doesn't work on your PC I will post it on an other site.

                                    Daniel