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] - [DBP] - [Matrix1] Visible Camera Fustrum

Author
Message
MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 25th Jul 2014 02:42
Visible Camera Fustrum
Visualise the space seen by a camera.



Notes
- there are bits of vector/3d maths scattered about the code. I haven't used DBP's native vectors because this was first and foremost a learning experience.
- the UpdateFustrum function requires the cameras fov, aspect, etc. be passed in a camData UDT variable. Feel free to modify this so it plugs into a project more readily.
- the full example includes some #constants tricks to allow compiling with/without some plugins. As a result, that code is a bit messy, but the pertinent bits are in the other example anyway.
- Original motivation for this was that the d3dfunc fustrum has some issues (don't remember what they are though).

Minimum Setup
Requires Matrix1Utils.



Simple Example
Requires Matrix1Utils.




(Full example in next post)
MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 25th Jul 2014 02:46 Edited at: 25th Jul 2014 02:46
(oops - the 'post too long' page put an extra [DBP] in the thread subject, didn't catch it)

Full Example.
Requires Matrix1Utils.
Optionally, can use ezRotate and d3dFunc, see #constants at start.




.
Burning Feet Man
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 17th Sep 2014 09:47
Monocoder, I was thinking about this the other day. I can't wait to get home and give your code a crack!

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia

Login to post a reply

Server time is: 2024-03-29 10:55:17
Your offset time is: 2024-03-29 10:55:17