BBC BASIC for Windows
« The Knight Rider effect( 3D light project) »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:06pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: The Knight Rider effect( 3D light project)  (Read 352 times)
michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
cheesy The Knight Rider effect( 3D light project)
« Thread started on: Mar 24th, 2016, 12:18am »

This is a conversion of the beginning of a project I envisioned.
The idea:
1) start from the ground up
2) define lighting (custom area)
3) work object up (width is manageable with this tool)
4) lighting is affected by object width sections
In theory, any complex object could be made to look 3D with the proper lighting..
This advances further than my 3D spheres and other emulated 3D objects, because it truly can have limitless possibilities.

Example: if you wanted to make facial contours you could define the depth/lighting for different regions using similar methods
OR
A side view of an object, ( like a 3D vase) could be made)
A chess piece could easily be made using this tool (with modification, as it isn't perfected..
BUT OH MAN!! This is A LOT faster on BBC !!!! :)
Code:
   
   REM SET MODE TO 8 USING VDU
      VDU 22,8
      REM SET LINE THICKNESS TO 3
      VDU 23,23,3|
      VDU 5
      OFF
      GCOL 1
      s=0

      x=0:y=0
      d=0
      e=90
      rate = 10 REM CYCLE RATE
      (cycle)
      IF d=0 AND s>e THEN (skip)
      IF d=1 AND s<e THEN (skip)
      PROC_ultimate(100,104,s,104)
      PROC_ultimate(100,100,s,100)
      PROC_ultimate(102,98,s,98)
      PROC_ultimate(104,96,s,96)
      PROC_ultimate(102,98,s,94)
      PROC_ultimate(104,96,s,92)
      (skip)
      IF d=0 THEN s=s+rate
      IF d=1 THEN s=s-rate
      IF d=0 AND s>e THEN d=1:e=0:GOTO (jmp)
      IF d=1 AND s<e THEN d=0:e=90:GOTO (jmp)

      (jmp)
      REM CLS
      GOTO (cycle)
      (mou)
      WAIT 0 : REM just wait, nothing to do !
      GOTO (mou)

      DEF PROC_ultimate(x,y,light,width) REM x,y,light startx,width of line
      r=250:g=250:b=250
      IF light>width THEN light=width
      origin=x+light
      FOR mov=origin TO x STEP -1
        COLOUR 0,r,g,b
        GCOL 0
        MOVE x+mov,y:DRAW x+mov,y
        r=r -2
        g=g -2
        b=b -2
        IF r<2 THEN r=2
        IF g<2 THEN g=2
        IF b<2 THEN g=2
      NEXT mov
      r=250:g=250:b=250
      destination=x+width
      FOR mov=origin TO destination STEP 1
        COLOUR 0,r,g,b
        GCOL 0
        MOVE x+mov,y:DRAW x+mov,y
        r=r -2
        g=g -2
        b=b -2
        IF r<2 THEN r=2
        IF g<2 THEN g=2
        IF b<2 THEN g=2
      NEXT mov
      ENDPROC
 
« Last Edit: Mar 24th, 2016, 12:30am by michael » User IP Logged

I like making program generators and like reinventing the wheel
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls