I have just come from out of town for valentines day and I have decided to do the raycast C++ tutorial(but coding in Lua) and I am having trouble followng it. I feel it isnt being explained properly for me to understand the concept. I have searched the forums and I cant seem to find any examples to help me get started. I was wondering if anyone could offer some help as to giving me a better example with in depth explanations of doing simple raycasting using cubes and the functions provided.
Like for instance this bit of code is whats confusing me, the sprintf....is that a function?
If anyone could provide a simple workflow(perferably in Lua) with doing simple raycasting that would help me out quite a bit. Thanks...
I dont really understand the code below because sprintf is where I got lost..
--Test and display visibility between two points
result=PointVisible(Vec3(4,0,0),Vec3(-4,0,0))
sprintf(temp,"Visible: %d",result)
DrawText(0,0,result)
--Display the tested line
point0=CameraUnproject(cam,Vec3(4,0,0))
point1=CameraUnproject(cam,Vec3(-4,0,0))
SetColor(Vec4(1,0,0,1))
DrawLine(4,0,-8,0)
SetColor(Vec4(1))