Hi all - I've searched through as many forum threads and tutorials as I could find, but I can't find the answers to these three questions:
1. Is there a simple DBPro replacement for the BASIC "Sgn()" function? I'm writing a Martin fractal program which (in my previous versions using other languages) contains the line:
X2 = Y-Sgn(X)*Sqr((Abs(B*X-C))
I've converted almost all of this line to DBPro (e.g. replacing "Sqr" with "Sqrt", and converting the variables to floats using the "#" sign), but I can't find an efficient way to convert the "Sgn(X)" function. For those who haven't seen this function before, "Sgn(X)" should return 1 if X is positive, zero if X is exactly zero, and -1 if X is negative. This function has been part of all the other versions of BASIC that I've ever used, including BBC Basic, GFA Basic on the Atari ST, etc. The only solution I can see at the moment is to write my own multi-line function, using select/case or maybe if/else, but that doesn't seem to be very efficient to me.
2. As every DBPro user probably knows, the "save bitmap" command was deleted from the language "
to make way for future enhancements providing much better support for all types of media exporting". Does anyone know where these enhancements are? When I create a nice-looking graphic on my monitor screen, I can
manually press ALT+PRINT SCREEN, then ALT+TAB to Paint Shop Pro and save it as a new image. Does anyone know how I can execute a procedure to save a simple bitmap (BMP format or any other recognised format, I'm not fussy) using
program code? IMHO the removal of the "save bitmap" command from DBPro was a mistake.
3. I've purchased the "Beginners Guide to Dark Basic Game Programming", but as has been mentioned in other threads, this does a very poor job of covering 3D graphics which is where Dark Basic really shines. Does anyone know of a more advanced book which really opens the horizons of Dark Basics' 3D capabilities? I don't just mean that it should list the 3D object and camera functions, but it should also go a little way into the background mathematics of creating 3D worlds on screen, including discussion of Dark Basics' vector variables and functions (e.g. cross products and dot products of vectors, the catmullrom functions etc.) An excellent book which first got me hooked on 3D graphics is "Microcomputer Graphics" by Roy Myers, published by Addison-Wesley. However, that was written in 1982, and the example code is written for Applesoft BASIC on the Apple II 48k micro! I need something a little more up-to-date now!
If anyone can help me to push the darkness back, and help me to stretch the superb Dark Basic Pro language even further, I would be very grateful.
Why do so many people lose the ability to spell the word "lose"?