RealTime Raytracing with Bmax ?
BlitzMax Forums/BlitzMax Programming/RealTime Raytracing with Bmax ?
| ||
Hi :) I have find this topic on a purebasic forum :) http://forums.purebasic.com/english/viewtopic.php?t=15568&postdays=0&postorder=asc&start=45 A guy have made a little raytracer in purebasic :) I'm thinking ? it is possible to do the same think in bmax ? i'm trying to understand the code but this couragous guy use pointer everywhere ! lol I find it funny to do the same with bmax :) here is some couragous man in bmax :) ? |
| ||
wow, that looks sweet, look like it will be a real mission to port that code. Sure it can be done though. |
| ||
Yeah blitz could do te same thing. You don't even really need to understand the code to do a direct port. Suggest u look for a tutorial if u actually want to learn how raytracing works - reverse engineering uncommented code may not be the most productive way! |
| ||
wow that pb guy likes bad code |
| ||
It's a killer :) But i'm not really specialist with pointer :( |
| ||
Structure xyz x.f y.f z.f EndStructure What is the f? A float? |
| ||
It must be -> Origin.xyz (of structure xyz)??? |
| ||
There was a book around which had the full source code to a ray tracer written in basic on the amiga... I still have it somewhere, hmmm wonder if its worth converting to another language .... |
| ||
The pure basic help say that about structur : Like say Daiblo i think that : Ambient.Color => Refer to another color structur pointer ?? Like this : --------- Structure Color Red.f Green.f Blue.f EndStructure And : WorldScreenSize.f => Refer to a float WorldScreenWidth.f => Refer to float |
| ||
Structure Scene Ambient.Color WorldScreenSize.f WorldScreenWidth.f WorldScreenHieght.f WorldScreenHalfWidth.f WorldScreenHalfHeight.f ScreenWidth.w ScreenHeight.w HalfScreenWidth.w HalfScreenHeight.w PixelStep.f RealPixelsStep.w EndStructure Then what is w? |
| ||
my guess is int b > byte? pos bool? |
| ||
I think that : f=float b=byte w=word s=string d=double there is many .f because raytracing technic use many float or double to compute picture color. |
| ||
then .l must be long? |
| ||
.I ? maybe Int ? |
| ||
the types in PB:Name Extension Memory consumption Range Byte .b 1 byte in memory -128 to +127 Word .w 2 bytes in memory -32768 to +32767 Long .l 4 bytes in memory -2147483648 to +2147483647 Float .f 4 bytes in memory unlimited (see below) String .s length of the string + 1 Up to 64000 characters *edit* oh.. and structures are the same as blitz' types.. |
| ||
Purebasic doc about pointer : |
| ||
I've converted some of the code, feel free to continue my work: |
| ||
I hope someone continue this :) i'll try to convert some function |