Code covered by the BSD License  

Highlights from
Doom 1.3

4.4 | 8 ratings Rate this file 17 Downloads (last 30 days) File Size: 4.36 KB File ID: #9340 Version: 1.0

Doom 1.3



12 Dec 2005 (Updated )

Fly through a 3D scene like in a first-person shooter in god mode

Editor's Notes:

This file was a File Exchange Pick of the Week

| Watch this File

File Information

Does the key combination WASD sound familiar to you? Did you ever look over the shoulder of your half-grown son, when he played his latest ego-shooter? Would you expect him to intuitively explore 3D data in Matlab much faster than you could ever do - with your good old 'zoom', 'pan', and 'rotate' buttons?

The next-generation engineer will use the 3D control scheme he has grown up with:

Mouse : Look up/down/left/right

'w' : Move forward
's' : Move backward
'a' : Move left
'd' : Move right
'Space' : Move up
'Ctrl' : Move down
'Shift' : Accelerate movement
'm' : Toggle up/down
'q' : Toggle mouse motion capture
'Esc' : Close figure

  z = peaks;
  surf (z)
  axis off

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (16)
23 Apr 2010 Danny Sale

As a "next generation" engineer who has grown up with this scheme, I found this the most intuitive way to visualize 3D objects. Excellent work and a very creative idea. Thank you!

27 May 2009 Thomas

Thomas (view profile)

Great work!
Another key to rotate the camera around its principal axis would be pretty awesome!

13 Dec 2008 Kenneth Eaton

Kenneth Eaton (view profile)


Did you fail to notice that this was a Pick of the Week? It would seem to make you look bad to give it such a poor rating, especially with no explanation why. John at least tried it out and had good critiques, which the author then incorporated into his code (to his credit).

24 Sep 2008 Reza Zahiri Azar

Nice function. It would have been nice to include rotation as well.


08 Jun 2007 Francesco Pilla


18 May 2006 Jörg Buchholz

There is a German paper called "Matlab Goes doom" ( throwing a bit of light upon the mathematical background of doom...

Comment only
20 Dec 2005 Jörg Buchholz

Marc, thanks alot for the drawnow idea. I implemeted it in version 1.3 and uploaded it.

John, thank you for your helpful problem analysis. Could you please try out version 1.3 ("will be published within the next 2-3 business days.") and tell me if your problem persists?

If you cannot reach me via (because your mail server is not RFC 2821 compliant) should accept mail from your server.

One more question: Why does ALT-TAB not work for you to make the figure window active?


Comment only
19 Dec 2005 Marc Lätzel

I had also problems with touching the mouse and the whole window froze, adding a
drawnow (or a disp(' ')) at the end of the mouse_moved function helped.

Comment only
19 Dec 2005 John D'Errico

Joerg - I tried to respond to your e-mail, but it bounces
with the error: Client host rejected: Access denied.

I've also tried doom with many different variations of mouse sensitivity, but any touch of the mouse causes unrecoverable problems. And I can't make the figure window active without mousing onto it. Only if the mouse
cursor randomly happens to lie in the space of the figure
when created, then I click the mouse button with absolutely no mouse movement does doom work, and then just barely (way too slow). One touch of the mouse at any time and doom lives up to its name, even at the absolute minimum mouse sensitivity.

Comment only
19 Dec 2005 Jörg Buchholz

thank you very much for your improvement suggestion. I just implemented an initial "bring the figure into focus" into version 1.2 and uploaded it, so it "will be published within the next 2-3 business days."

Workaround until then: Whenever the mouse cursor is outside the figure you can press "q" twice to position it into the center of the figure. (And you can always use ALT-TAB to bring the figure into focus.)

Comment only
17 Dec 2005 John D'Errico

I fail to see what is so impressive here. Its not at all easy to use, way too sensitive to the mouse. Since I need to mouse into the window to bring the figure into focus, as soon as I do, the axes disappear completely out of the figure window. Once this happens, the figure appears to be irretrievably lost.

15 Dec 2005 Jörg Buchholz

it's on my to-do-list...

Comment only
14 Dec 2005 Terry Eldridge

Wow! This makes analyzing 3D plots I've created (e.g., antenna patterns, refracting RF rays) much faster! Thanks!

Now for a request: is there a way you might be able to incorporate a rotation command about the camera location (possibly through another 'toggle' button which lets the mouse movement control the rotation)? You mentioned in your description 'zoom', 'pan' and 'rotate', and now I'm hoping you can include the 'rotate'part!

13 Dec 2005 - -

It doesn't work for MATLABR11 :(

Comment only
13 Dec 2005 Jörg Buchholz


a mouse capture toggle key is a helpful suggestion; I just implemented it and uploaded version 1.1.

But I do not have the slightest idea how to get the information from Matlab that the user pressed 'a' and 's' simultaneously.


Comment only
13 Dec 2005 Jean-Yves Tinevez

Works great and fun. Easy to edit (to translate to french keyborad e.g.) and well documented. Would it be possible to be able to account for the pressing of 2 keys simultaneously ? E.g. strafe left + move backward. A key to switch mouse capture on/off would also be a plus.

13 Dec 2005

Version 1.1: Mouse motion capture can be toggled via key 'q'

14 Dec 2005

new source file

19 Dec 2005

Version 1.2: Initially, bring the current figure into focus

Contact us