Solved

3D Lingo: key control of camera view

Posted on 2003-11-02
5
257 Views
Last Modified: 2013-12-24
Hi expert folks,

I want the following interaction in a movie:

The default view in a w3d world is, say view #1. Whenever the user presses the command/ctrl key, the camera view changed to view #2;  when the key is released within one second, the view changes back to view #1. But if the user keeps the key pressed, the view automatically changes back to the default view after one second.

Thanks.

idOle
0
Comment
Question by:idOle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 20

Accepted Solution

by:
MediaMacros earned 100 total points
ID: 9670828
Use a keyDown script and a timer.  Basically a movie script like this...

global gTimer

on keyDown me
  if the key = "2" then
    --swap your camera
    --set a timer value
    gTimer = the milliseconds
  end if
end

on keyUp me
  if the key = "2" then
    --it was released so set it back to camera 1
    gTimer = 0
  end if
end


Then you can either use a timeout object to track the time or use an exitFrame script like this...

on exitFrame me
  if gTimer = 0 then exit
  if gTimer + (1000 * 60) < the milliseconds then
    gTimer = 0
    --set it back to camera 1
  end if
end
0
 

Author Comment

by:idOle
ID: 9674513
I am not sure I am right but this seems not working for me. The problem is whenever the "ctrl" key is pressed, gTimer keeps updating to the milliseconds on "on Keydown" handler, instead of just being set once.

Any insights? Thanks.

idOle
0
 
LVL 20

Expert Comment

by:MediaMacros
ID: 9678571
Well this is pseudo-code, not totally written for your use.  Instead of key 2 look for the controlDown to see if ctrl is clicked.  
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question