Tools Links Login

Realtime simple raytracer (updated 30 April 2002)

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.

Original Author: Almar Joling

Assumptions

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

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 102 times

Categories

Visual Basic 6

Attachments

Realtime_s775124302002.zip
Posted: 9/3/2020 3:45:00 PM
Size: 29,314 bytes


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.