VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Realtime simple raytracer (updated 30 April 2002)

by Almar Joling (9 Submissions)
Category: Graphics
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (51 Votes)

Updated by Bill Soo... instead of 25 fps, it runs at 60 fps now! Which is an astonishing framerate for VB
Again some pretty unique code from me. This program is a _realtime_ raytracer (not raycaster!). I ported it from C++ to VB, and it still runs pretty fast. It also shows you how to use SetDibbits to change all the bits in a picturebox with just one call. You can zoom in and out, add more spheres by changing a few variables/constants in the code. Light-positions can be set by the scroll bars and changes will be visible directly!
Note: Please compile this program, or you will receive ~1-2 FPS from the IDE.
I would appreciate some votes, people, so that I can still think my (unique) work is appreciated =-)
Update: I've moved some math functions inline, and improved the code wherever it was possible. 10fps more now! Do not forget to compile the program though... Original source is also included. I'd really appreciate if you vote for this code guys.

Assumes
I assume that you have some knowledge about "what a Raytracer actually is"
API Declarations
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Declare Function SetDIBits Lib "gdi32" (ByVal hdc As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long

Rate Realtime simple raytracer (updated 30 April 2002)

Download Realtime simple raytracer (updated 30 April 2002)

Download Realtime simple raytracer (updated 30 April 2002) (28 KB)

Realtime simple raytracer (updated 30 April 2002) Comments

No comments have been posted about Realtime simple raytracer (updated 30 April 2002). Why not be the first to post a comment about Realtime simple raytracer (updated 30 April 2002).

Post your comment

Subject:
Message:
0/1000 characters