Liberty BASIC Community Forum
« Knight Rider -Experimental lighting 3D project »

Welcome Guest. Please Login or Register.
Sep 21st, 2017, 11:03am


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Knight Rider -Experimental lighting 3D project  (Read 259 times)
michael
Team Liberty BASIC


member is offline

Avatar




PM


Posts: 111
xx Knight Rider -Experimental lighting 3D project
« Thread started on: Feb 22nd, 2016, 05:25am »

In an instance, the lighting of a stack of lines of this sort could eventually give simulated lighting.

I am currently working on extremely detailed lighting from this idea..
This technique could also be applied to overhead lighting if width is given priority for the pixel levels that are wider and mixing with this current program idea.

RATE adjusts the speed of the cycle..

This may not be that fast and may be only practical for making complex 3D objects for image capture.(BMP)

This is just a really rough example.. I plan to make super high quality 3D objects using this method.

(its super low quality with large pixel size and is drawn exclusively with pixels)


Code:
global x
global y
call screen 800,600' Generic screen with graphics box to fit ( I may redesign)
'*******************************place graphics bellow here use #h.1 for draw device
x=0:y=0
d=0
e=90
rate = 10' cycle rate
[cycle]
if d=0 and s>e then [skip]
if d=1 and s<e then [skip]
call ultimate 100,104,s,104
call ultimate 100,100,s,100
call ultimate 102,98,s,98
call ultimate 104,96,s,96
call ultimate 102,98,s,94
call 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]
scan
[jmp]
cls
goto [cycle]

'^^^^^^^^^^^^^^^^^^^^^^Put graphics and game stuff above^^^^^^^^^^^^^^^^
wait
[quit]
 close #h
 end

 ' Generic screen
sub screen x,y
nomainwin
WindowWidth=x
WindowHeight=y
UpperLeftX=0
UpperLeftY=0
graphicbox #h.1, 0,0,x-1,y-1
open "Generic Window Host" for window_nf as #h
print #h, "trapclose [quit]"
#h.1 "backcolor black;fill black;cls"
#h.1 "color white"' default color if no color has been chosen
end sub
sub ultimate x,y,light,width '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
#h.1 "down;size 4;color ";r;" ";g;" ";b
#h.1 "set ";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
#h.1 "down;color ";r;" ";g;" ";b
#h.1 "set ";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
end sub

 
« Last Edit: Feb 22nd, 2016, 05:36am by michael » User IP Logged

I like making program generators and reinventing the wheel.. I never make mistakes.. Not ever.. (lie)
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls