View Full Version : A 3D turtle with a constant lap.
Hi all,
Taking up previous code, the turtle does (m,HorAngle,VerAngle) now -- but m is still not a variable (his has to be changed in the future to close graphics ).
In the code string : m is move , Number1 the Horizontal and Number2 the Vertical angle.
The string is parsed into a numeric array, which works faster and after the m is coded into Mike numbers :-) two this times , the loop counts / 2
To do : m -> any distance -- or more clever a "snap onto the neares point" function.
best Rob
Max 120000 lines - what is the maximum that is still do-able for TBGL and a recent 'puter ??
attached , the so far so good -- beter watched with maximized window.
mike lobanovsky
02-12-2013, 22:29
Rob,
Terrific! :o Works smooth for me and looks good too. I'm perfectly sure you can turn it into a fool-scale turtle pretty soon.
I'm also well into some rather spectacular 3D fractal thingy. I hope I'll be able to release it in a couple more days. Though I'm not sure it'll use TBGL for what it does... ;)
Regards,
Petr Schreiber
03-12-2013, 13:20
Hi Rob,
I think there is no limit by design on the number of geometric primitives. I guess it is dependant on the installed GPU memory.
How the line is stored depends on implementation, but basically when taking just geometry:
line is defined by 2 points
each point has 3 coordinates
each coordinate is represented as float/single = 4 bytes
that would give us 2 * 3 * 4 = 24 bytes for separate line segment
Today, the installed GPU memory is no lower than 512 MB (some megabytes are consumed by framebuffers, but nothing drastical), so it is safe to presume you have lot of space for experiments :)
Mike,
I am looking forward to your example!
Petr
Thanks Mike, Petr ,
Full 3D turtle -- yes, the maths are easy -- the coding somewhat more difficult , we'll see ...
(still avoiding recursive code for the moment).
Also looking forward , Mike
best Rob
mike lobanovsky
06-12-2013, 03:52
Hello Petr, Rob,
I just got a little more involved with what I originally intended to do and switched over to FBSL. It is easier and much faster for me to code in it, so I decided to work on the project some more and then publish a somewhat simplified version in thinBasic+TBGL too. The picture below should give you an idea what I'm trying to do, of course primarily for my own fun. :)
Regards,
Hi Mike, looking formidable !!
Animations or static ??
best Rob
Petr Schreiber
06-12-2013, 14:06
Hi Mike,
it is possible to use shaders from within thinBasic, I posted multiple examples, for example here:
http://www.thinbasic.com/community/showthread.php?t=10033
I personally prefer CG over GLSL, because it allowed me to work even with Intel cards in dark times of Intel drivers and it can be used in Unity.
But I understand you prefer to design it in your "home" language, I also use ThinBASIC at work while others dance with Python and C :)
Petr
mike lobanovsky
06-12-2013, 15:15
@Rob
Static?! Noooo... Fly-through-able of course, using the navigation controls as described in the help pane at the right side of the snapshot. But make sure to upgrade to a GLSL-capable videocard before I finish this work. It's well worth it! :)
@Petr
Thanks for the reference! I looked through most of them in the past but when it comes to actual coding, one always keeps forgetting where one has seen this or that piece. That's why my monitor desktops are always full of icons of the content I download as soon as I see something interesting. The zips stay on my desktops until I actually have time to unzip and see if it's worth any further investigation and/or implementation. Based on this, I either copy the content to one of my disks or delete it mercilessly. :)
GLSL is implemented via CG on modern nVidia drivers. CG actually understands HLSL, GLSL and assembly. And I've even seen some fair shader translators on the net built around this compiler. They help you translate your GLSL code to HLSL and vice versa automatically and quite successfully too.