Solved

3D Lingo: key control of camera view

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

820 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