Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] 3D Bezier Curve

Author
Message
MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 25th Aug 2010 22:57 Edited at: 25th Aug 2010 23:02
Probably bindun, but I'm learning it at the moment so figured I'd share. Currently very sloppy code, but it works and I'll call back a few times to fix it up and add features and things to it. Uses Matrix1Utils, but you can get round having to use it by getting rid of the "random(?)" bits and replacing them with "(rnd(?*10.0)/10.0)" or something.

Move mouse to orbit camera, scroll mousewheel to zoom in/out. Press control to re-randomize the points, hold shift to slide the middle point along x/y (quick and easy visualisation aid-y thing), or hold space to watch the bezier being traced. Lower cBezierSamples to make the curve less smooth/faster to draw, and vice versa.



Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 27th Aug 2010 17:30
Interesting snippet . If you expanded on it you might be able to make a pretty cool screen saver.


Guns, cinematics, stealth, items and more!
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 28th Aug 2010 11:30 Edited at: 21st Mar 2011 06:45
[edit] nm O_o

maggiemiller
14
Years of Service
User Offline
Joined: 24th Sep 2010
Location:
Posted: 24th Sep 2010 09:38
They are really nice information from you, I think a Bezier curve is a parametric curve often used in computer graphics and related fields, well, I think the 3D surface patches Bezier, they are defined by the network of 16 control points (4 rows 4 columns). Each row of four control points can be seen as a separate 2D Bezier curve.

Login to post a reply

Server time is: 2024-11-21 20:24:33
Your offset time is: 2024-11-21 20:24:33