Recent Posts

Pages: [1] 2 3 ... 10
1
Open Forum / Re: Rubic's Cube Code Challenge
« Last post by John on June 17, 2018, 09:25:43 PM »
2
Open Forum / Rubic's Cube Code Challenge
« Last post by John on June 01, 2018, 10:57:00 PM »
Online Rubic's Cube Simulator

The direction I would like to see happen with this challenge is use the JavaScript version as a guide to rework the O2 Pine Cone GL example. I personally don't have the skills level with graphics programming to do the merge. I'm just the facilitator in this effort.

If this materializes, I suggest we call it RobbeK's Cube as a tribute




Code: OxygenBasic
  1.   #compact
  2.   % Title "PineCone"
  3.   % Animated
  4.   % ScaleUp
  5.  '% PlaceCentral
  6. '% AnchorCentral
  7. '% NoEscape
  8.  % ColorCodedPick
  9.   % MultiSamples 4
  10.  
  11.   includepath "$\inc\"
  12.   include "ConsoleG.inc"
  13.  
  14.  
  15.   function makelist() as sys
  16.   ==========================
  17.  
  18.   type coor float x,y,z
  19.  
  20.   static coor z
  21.   static float golden_angle = 137.508  
  22.   static float golden       = golden_angle*Pi/180
  23.                                      
  24.   macro floret(n, r,ang,xc,yc) 'inner procedure
  25.  ----------------------------
  26.   float r , ang , xc , yc
  27.   r =(5.3 * Sqr(n*golden))
  28.   ang = (n*golden)
  29.   xc = r*Cos(ang)/100
  30.   yc = r*Sin(ang)/100
  31.   z.x=xc : z.y=yc
  32.   end macro    
  33.  
  34.   sys i
  35.   static sys seeds
  36.   seeds=CompileList seeds
  37.   for i=1 to 140
  38.     floret(i)
  39.     glPushMatrix
  40.     glTranslatef z.x , z.y , i/100
  41.     scale 0.11+i/900
  42.     go sphere
  43.     glPopMatrix  
  44.   next  
  45.   for i=144 To 1 step -1
  46.     floret(i)  
  47.     glPushMatrix
  48.     glTranslatef -z.x , -z.y , 2.2-i/200
  49.     Scale  0.11+i/1000
  50.     go sphere
  51.     glPopMatrix  
  52.   next
  53.   glEndList
  54.   return seeds
  55.   end function
  56.  
  57.  
  58.  function main()
  59.   ===============
  60.   sys i,p
  61.   string s
  62.   float  a
  63.   cls 0,0.1,0.2
  64.   '
  65.  shading
  66.   '
  67.  pushstate
  68.   move 15,-15,-20
  69.   static MoveableObject seeds
  70.   static sys            seedform
  71.   static sys            idf
  72.   if not idf
  73.     idf=100  
  74.     seeds.snap=.5
  75.     seeds.id=idf
  76.     seeds.mode=0x100 'keyboard & mouse (left button rotate)
  77.    SeedForm=MakeList()
  78.   end if
  79.   picked=idf 'always selected
  80.  seeds.act
  81.   scale 10
  82.   move 0,0,-1
  83.  'static float ay
  84. 'rotateY ay : ay+=.2
  85.  if not pick then
  86.     SilverMaterial.act
  87.   end if
  88.   go SeedForm
  89.   'go cylinder
  90.  popstate
  91.   '
  92.  'F1 HELP
  93.  '
  94.  if key[0x70]
  95.     flat
  96.     pushstate
  97.     move 20,0
  98.     color .9,.9,.9
  99.     scale  1.5,1.0
  100.     printl "Active Keys:"
  101.     printl
  102.     scale  1/1.5,1.0
  103.     printl "Esc"    tab "Exit"
  104.     printl "Ctrl-P" tab "Take snapshot"
  105.     printl "F1 This help panel"
  106.     printl "Arrow keys PgUp PgDn to move"
  107.     printl "Ctrl Arrow keys PgUp PgDn to rotate"
  108.     printl "+ - keys to scale up and scale down"
  109.     printl "Ctrl Home to reset rotation"
  110.     printl "Shift for faster movement"
  111.     printl
  112.     scale 1.5,1.0
  113.     printl "Mouse:"
  114.     printl             
  115.     scale 1/1.5,1.0
  116.     printl "Point to Object, then"
  117.     printl "Left button to move"
  118.     printl "Middle button to scale"
  119.     printl "Right button to rotate"
  120.     printl "Wheel to move in Z direction"
  121.     popstate
  122.   end if
  123.   picklabel 0
  124.   lastkey=0
  125.   lastchar=0
  126.   end function
  127.  
  128.   EndScript
  129.  

Attached is Mike's 32 bit version of RobbeK's contribution. (.exe)
3
Open Forum / Re: What BASIC to use?
« Last post by John on May 28, 2018, 02:04:46 PM »
AIR,

I just wanted to say if it wasn't for your Script BASIC contributions, the interpreter would be nowhere close to where it is today.

THANK YOU!!!
4
Open Forum / Re: What BASIC to use?
« Last post by AIR on May 28, 2018, 11:30:08 AM »
AIR,

Do you find yourself using Script BASIC for anything?

I think it's a solid product once you familiarize yourself with it, but I don't actively use it myself.
5
Open Forum / Re: What BASIC to use?
« Last post by AlyssonR on May 28, 2018, 01:47:14 AM »
QB64 ...

I only use QB64 when I have a management script I need to run on my servers that was originally developed in QuickBasic, or I need a quick and dirty file dump with formatting.
6
Open Forum / Re: What BASIC to use?
« Last post by John on May 27, 2018, 11:15:04 PM »
AIR,

Do you find yourself using Script BASIC for anything?

7
Open Forum / Re: What BASIC to use?
« Last post by AIR on May 27, 2018, 04:47:35 PM »
Honestly, since the state of BASIC on MacOS is mostly crap (Xojo is the only possible exception, but I'm not willing to pay the yearly subscription for the full Desktop/Mobile/Web/Database-Enabled version), I don't have a choice as far as BASIC.

I wanted to like QB64 but because they insist on opening up a separate terminal when I'm launching an app from the terminal, I quickly dropped it.  Additionally, their build scripts on MacOS don't work without some fixes (good thing I know BASH).  The final kicker was a 1.1 MegaByte "Hello World" app.  Their forums were no help, since apparently there's a database issue with it.

I find myself using NIM a bit these days, when I'm not using ObjC.  On the Windows side, I use C# (or AutoIt3 when I need something quick).

AIR.
8
Open Forum / Re: What BASIC to use?
« Last post by AlyssonR on May 14, 2018, 12:01:49 PM »
Most of what I do is embedded microprocessor stuff usning Arduino (Arduino C++), but interfaced to the host system using either VB6, VBScript or an interpreted BASIC.

Script Basic is my usual go-to interpreter, but I have been known to use QBASIC-64

VB6 is useful as it is pretty close to being identical to VBA in the Microsoft Office suite and VBScript - which means that I can just drop in most of my code (functions and subs, mainly) where it is needed.
9
Open Forum / Re: What BASIC to use?
« Last post by John on May 13, 2018, 07:17:33 AM »
I tend to use Script BASIC as the core language and C extensions for the vast amount of open source libraries and for performance if needed.
10
Open Forum / Re: What BASIC to use?
« Last post by AlyssonR on May 13, 2018, 01:45:14 AM »
Nobody wants me to program anything for them.

Probably just as well, really - I'm still stuck using VB6 as a compiler, but all manner of interpreted BASICs go into things I write.
Pages: [1] 2 3 ... 10