File Exchange

image thumbnail


version (3.97 KB) by jiro
GUI example of 3D gear. Use mouse to roll the gear.


Updated 01 Sep 2016

View Version History

View License

***This has no practical use. I made it as my own exercise for 3d animation. You have been warned.***
GEAR3D GUI example of 3D gear.

GEAR3D will pop up a GUI example of 3D gear. The gear rolls on a geared ground based on the mouse location. It uses the x-location of the mouse pointer for the gear location. Use the arrow keys to change the view. Press SPACEBAR to reset the view. This was inspired by Mike Agostini's 3D Clock submission in FEX:

The gear is made of 2 surface objects, and the ground is a single surface object. Since the moving part (gear) only contains 2 objects, the animation update is quite smooth. It uses OpenGL rendering.

GEAR3D accepts 3 optional arguments that specify the number of teeth on the gear, number of spokes, and the gear ratio between the ground and the gear.

GEAR3D('teeth', 30) - default is 50.
GEAR3D('spokes', 4) - default is 8.
GEAR3D('ratio', 2) - default is 3. This also determines how big the ground radius is.

Only positive integers are allowed.

This was created in R13SP1, so nested function is not utilized. Nested function will improve how surface data are passed between functions.

Cite As

jiro (2021). GEAR3D (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)

hari krishnan

Ali Osman

wow.. good

Mr Smart

Ali Khan

Nice Work Man. Anyway, I am doing some work in designing helical gears. Trying to find something related to this. If you have any idea please let me know.

kushal khanal

a job i want to do too.

Terry Eldridge

Thanks! Gives me some really good ideas for my solar array deployment simulation...

Matt Fig

Very nice, well done.

YOgesh Mehta

Simply superb and well commented. Thanks for sharing...

John D'Errico

While i agree with the author that this has absolutely no practical use, I also see it as a nice learning tool. It is well enough commented internally so you can follow what was done. My choice of a rating was difficult. I chose to view this as a darn nice implementation of something totally useless, but still pretty.

MATLAB Release Compatibility
Created with R13SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: 3d Clock with geartrain

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!