Liberty BASIC Community Forum
« 3D Ellipse ring (full customize) »

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: 3D Ellipse ring (full customize)  (Read 222 times)
michael
Team Liberty BASIC


member is offline

Avatar




PM


Posts: 111
xx 3D Ellipse ring (full customize)
« Thread started on: Feb 21st, 2016, 07:17am »

Anyone can now use this custom 3D ellipse ring
Adjustable
1) first 2 coordinates are the height and width of the center hole
2) the next 2 coordinates are the location of the ring
3) the next 1 coordinate is the size ( total initial width of the ring ( CAN NOT BE LARGER THAN THICKNESS)
4) the next 1 coordinate is the thickness (evaluating this)
5) the next 3 numbers are the RGB color controls
6) the last number is the dimmer. 1-20 (larger for thinner objects)
'centerheight,centerwidth,x,y,size,thickness,R,G,B,dimmer'

This program is working well, but I think I may be making more coordinates than are necessary.
The size should be enough.. The thickness is a factor that is functional, but I think the size should be able to control that..
The size is over and above the center size
Anyways this works.
Code:
call screen 800,600' Generic screen with graphics box to fit ( I may redesign)
'*******************************place graphics bellow here use #h.1 for draw device
'centerheight,centerwidth,x,y,size,thickness,R,G,B,dimmer' oops

call ellipsering 200,100,200,200,150,100,200,200,200,2

call ellipsering 10,20,300,400,200,100,200,50,200,2
call ellipsering 50,200,500,400,200,100,50,145,50,2




'^^^^^^^^^^^^^^^^^^^^^^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 ellipsering centerh,centerv,h,v,size,thickness,x,c,a,dimmer ' dimmer cannot be more than 24- this command is sprite ready
if size > thickness then size = thickness
oc=thickness/2
outcenterh=centerh+oc
outcenterv=centerv+oc
r=0
switch=0
depthcount=size/2
for y=1 to depthcount
#h.1 "place ";h;" ";v
#h.1 "down"
#h.1 "color ";x;" ";c;" ";a
#h.1 "size 2"
#h.1 "ellipse ";outcenterh-r;" ";outcenterv-r
#h.1 "ellipse ";outcenterh+r;" ";outcenterv+r
r=r+1

[jump]

x=x-dimmer
c=c-dimmer
a=a-dimmer
if x<2 then x=2
if c<2 then c=2
if a<2 then a=2
next y
#h.1 "flush"
end sub


 
« Last Edit: Feb 21st, 2016, 07:18am 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