RealTime Raytracing with Bmax ?

BlitzMax Forums/BlitzMax Programming/RealTime Raytracing with Bmax ?

Filax(Posted 2005) [#1]
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 :) ?




SillyPutty(Posted 2005) [#2]
wow, that looks sweet, look like it will be a real mission to port that code.

Sure it can be done though.


Who was John Galt?(Posted 2005) [#3]
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!


boomboommax(Posted 2005) [#4]
wow that pb guy likes bad code


Filax(Posted 2005) [#5]
It's a killer :) But i'm not really specialist with pointer :(


nawi(Posted 2005) [#6]
Structure xyz
x.f
y.f
z.f
EndStructure

What is the f? A float?


Diablo(Posted 2005) [#7]
It must be -> Origin.xyz (of structure xyz)???


GrahamK(Posted 2005) [#8]
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 ....


Filax(Posted 2005) [#9]
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


nawi(Posted 2005) [#10]
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?


Diablo(Posted 2005) [#11]
my guess is int
b > byte? pos bool?


Filax(Posted 2005) [#12]
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.


nawi(Posted 2005) [#13]
then .l must be long?


Filax(Posted 2005) [#14]
.I ? maybe Int ?


LarsG(Posted 2005) [#15]
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..


Filax(Posted 2005) [#16]
Purebasic doc about pointer :




nawi(Posted 2005) [#17]
I've converted some of the code, feel free to continue my work:




Filax(Posted 2005) [#18]
I hope someone continue this :) i'll try to convert some function