Qbasicnews.com

Full Version: Raytracing the Moebius strip...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
It's quite complex (more than I expected), and I have to proceed step by step, but the first attempts are giving the beginning of a result:
[Image: MOEBIUS.JPG]

The green outline is here only to check that the raytracer hits the shape in the right area... The points which are plotted correspond to one root out of the three possible ones, and the normal is not calculated yet... But I think I'm on the right way now!
moebius strip sounds familiar...what is it?

i still cant get TC-RAY to work...Sad
Quote:moebius strip sounds familiar...what is it?
It's the strip that has only one side, though it looks like an object that has two sides...

Quote:i still cant get TC-RAY to work...Sad
Tell me more, you probably don't have all the files in the right directory:
you must launch QB4.5 with qb.qlb if you want to use the video lib. You must have FFix to speed up QB. Then you need: TcRay21.bas, TcBmp or TcLib17.bas, and Tclib17.bi. You load all these .bas in QB4.5, declare TcRay21.bas as the main module, and it should work...
a mobius strip is a one-sided object.

take a thin strip of paper, turn only one side over 180 degrees, and tape the two ends together. if you following your finger along one side, you will go over the entire shape, you can't make two distinct sides. It's a little geometrical anomaly.
Jark and Aetherfox:
This way it will not work!
The three bas files have a line saying
Code:
'$INCLUDE:'c:\qb45\tclib17.bi'
so user should explicitly create the dir c:\qb45 and store tclib17.bi there.
It would be fine to edit the .bas files to remove the path in the INCLUDE lines, this way the .bi could be in the working directory or in any place configured in QB.ini.

I have never reported it as I considered it just a small annoyance ,i just edit the files after download..
Moebius strip continued:

1) Paint one side green and the aother red :lol:
2)draw a line alongside the whole strip and then cut alongside
the strip Big Grin
I have hardcoded the path in my files mainly to get rid of XP's fantasy, Antoni: when i was under w95, I could launch a .bas directly from explorer by clicking on the icon, and everything was fine: both QB and Windows foun dthe right files at the right place.

Now, with XP, since I never really understood how this weird OS reacts in front of a Dos program, I prefered to hard-code the path: my progs work fine and easily only if everything is in a single directory. Everytime I tried something else, then a file was missing.

I will clear the path in my .bas files, Antoni, so that others will place the files wherever they want, but with XP on my machine, the easiest is, unfortunately, to put everything in a C:\QB45 directory...

BTW: I have separated TcRay in 2 modules, like you did yourself. It works fine from the IDE, but I still have a memory overflow when I try to compile... I may have to create a Maths module, with the equation solvers and other routines of that kind...

I have only 2 .bi files :
1) TcRay.bi, used by TcRay22.bas and TcrInit.bas
2) TcLib17.bi, used by the three .bas of the prog

The Const.bi file was not necessary: I don't remember why you had to create this one... :???:
As for the moebius band you're making Jark, it's quite a complex object, which according to maths can't exist (every object has 2 or more sides, excluding the boll).
However, if you do it (and I think you will), you can try to raytrace something like the Esher impossibilities... Wink
Jark:
For the directories problem this is how i solved it for W2000
My QB shortcut does not call QB in the QB dir, it calls a QB.bat file in the same directory as the source files.
Command line: qb.bat
Working directory: . (a dot)

Then I have a qb.bat I copy in all source directories I create
Code:
SETLOCAL
path=%path%;c:\archiv~1\qb        (that's my qb dir)
qb  %1  /lffix2.qlb                     (ffix2 is my blend  of ffix and qb.lib)

Then I have the file association of the .bas extension calling the shortcut qb.pif, not the executable qb.exe.

This way I can just double click a bas file and qb opens with the file loaded.

I have also splitted TC-Ray and I compiled it without a problem. I just separed the Menu and the Demox.Inits. But i don't know which version are you on....Big Grin
I will sure try that .pif trick ! XP is a real pain in the... for dos files management: with W95, there was no problem, the standard files associations worked perfectly.

I use a qb.bat that I launch from the run commande line of XP menu... and I also have a merged qb.qlb + ffix lib Smile
Pages: 1 2