Solved

3D Lingo: key control of camera view

Posted on 2003-11-02
5
244 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
  • 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. 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 :…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now