Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Hemlos

#31
ps snoopy needs to be added to the poll.
#32
For my AVG AV program i think it checks each program on first run, after anything is compiled and run.
Only once, and on first run only.
#33
Nice work Snoopy, that high pitch sound though, scared me lol
#34
Qedo i don't know how that works, but i want to figgure it out!
Looks really cool!
#35
Fantastic dreamerman, really nice!  :good:
And thank you for this, it might be useful for something i'm working on.
#36
Quote from: Snoopy on 2019-Apr-24
I will try to do something (I like the concurence friendly). The code of WPShadow is simpler but the optical effect is nice (and according to the rules of the contest, the complexity doesn't matter this time).

Sounds good, looking forward to more entries.
I like these contests because it gives access to some cool functions.
The more the merrier!
#37
I'm not a pro, but i have read a few books.
And to give credit where it's due, Gernot was a huge influence on my thirst for math.
I'm looking forward to more entries!

About the program, it was simply really.
It was a benchtest program to show what the function DrawStar() could do.
DrawStar was a brainstorm, as you can see in the remarks of the function showing a progression of the idea.
All the effects, are a result of using several combinations and configurations of this function:
Code (glbasic) Select
DrawStar(x%, y%, Color#, NumberOfPoints%, TextureID%, Rotate#, Depth#)

#38
This is an experimental piece i tinkered with a few years ago, hardly worth being called art.
It uses a rocking motion of sins and cos. eg. -1 to 1 to -1 to 1 etc

1. compile fullscreen 1920x1080
2. dont forget to grab this background image, or the special effect at the end will not look right.


Code (glbasic) Select
// --------------------------------- //
// Project: ColorPalette
// Start: Saturday, August 08, 2015
// IDE Version: 12.312


// compile 1920 x 1080 resolution fullscreen

LOADSPRITE "sky2.png", 9999

WHILE TRUE

STATIC a# = 0
a# = a# + 0.1
IF a# > 359.0
a# = 0.0
ENDIF
b# = SIN(a#) * 127.0

// the meters - still experimenting with colors..these are read to go...they have inputs [0.0..1.0] or [-1.0..1.0]
METER_Volume(30,40,20,300,SIN(a/2))
METER_SINE(60,40,20,300,SIN(a) )//, 0x604020, 0x707070)
METER_SINE(90,40,20,300,COS(b) )//, 0x604020, 0x707070)

// stars
DrawStar(200,500, 0xffffff, 5 , -50 , a , 0.5)
DrawStar(300,600, 0xff00ff, 5 , -100 , a , 0.75)
DrawStar(200,640, 0x808080 + RGB(COS(a)*127,128,0), 24 , -128 , 0 , SIN(a) * 1.0)
DrawStar(200,640, 0x808080 + RGB(0,COS(a)*127,128), 24 , -128 , a , 0.2)

// fractal sun
// this one needs HEAVY experimenting!
MakeSun(960,540, 2048, 2048+COS(b)*2048, 1, RGB( (127+COS(b*10)*127), (127+SIN(b*10)*127),COS(b*5)*127+127), 0x000000, b#, 0.1)  //this is the fractal...its a lil messy
IF (GETTIMERALL() >20000)
c=c+0.01
IF c>1.0 THEN c=1.0
DrawStar( 940, 540, 0xffffff, 5, 9999, a, c)
ENDIF
IF (GETTIMERALL() >24000) THEN END


SHOWSCREEN

WEND

//
FUNCTION MakeSun: x1%, y1%, Points2%, Size2%, Wander%, Color#, Color2#, Angle#, Depth#
DrawStar(x1% , y1%+2 , Color#, Points2%, -Size2%  ,  COS(Angle#)*2.0, Depth#)
DrawStar(x1% , y1% , Color2#, Points2% , -Size2% ,  0 , Depth#)
RETURN 0
ENDFUNCTION



FUNCTION METER_SINE: x%, y%, w%, h%, Level#, Color1% = 0x00f0f0, Color2% = 0xf0f000 // Level# = -1.0 to 1.0 eg. [-1.0..1.0]
IF Level# < -1.0 THEN Level# = -1.0
IF Level# > 1.0 THEN Level# = 1.0
PRINT Level,10,10
LOCAL MeterLevel# = (h% - 1 ) * Level#
POLYVECTOR x%,y%,w%,h%,0x0000f0
DRAWRECT x%+2,y%+2,w%-4,h%-4,Color2%
DRAWRECT x%+4,y%+4,w%-8,h%-8,Color2% * 0.4
DRAWRECT x%+4,y%+(h%/2),w%-8,-MeterLevel#/2,Color1%
RETURN 0
ENDFUNCTION


FUNCTION METER_Volume: x%, y%, w%, h%, Level#, Color1% = 0x806040, Color2% = 0xf0f000 //Level# = 0 to 1.0 [0..1]
IF Level# < 0 THEN Level# = 0
IF Level# > 1.0 THEN Level# = 1.0
PRINT Level,10,10
LOCAL MeterLevel# = ( h% - 4 ) * Level#
DRAWRECT x%,y%,w%,h,Color1%
DRAWRECT x%+4,y%+4,w%-8,h%-9,Color1% * 0
DRAWRECT x%+4,y%+h%-4,w%-8,-MeterLevel#, Color2%
RETURN 0
ENDFUNCTION


FUNCTION DrawStar: x%, y%, Color#, NumberOfPoints%, TextureID%, Rotate#, Depth# // make some stars! -TextureID# = SIZE If No Sprites ID is supplied. (-) Negative ID
// Star Creator Code Designed Neil M. Silver,  Aug. 9, 2015
//
// The Algorithm:
// --
//   NumberOfPoints = Number of visually obvious points, eg. An American Star is 5 pointed.
// --
//   Vector Count = The number of actual vectors a polyvector needs, in fan mode, can be calculated:
//
//     ( V = P * 2 + 2 )
//     VectorCount% = ( NumberOfPoints% * 2 ) + 2 )
//     Note: Add Two, one for the center point, one for the last point.
// --
//   VectorAngleSize% = is the turn size for each vector to draw.
//     ( A = 180 / P )
//     VectorAngleSize# = ( 180.0 / NumberOfPoints% )
// --
//   Depth%
//     The inner and outer radius represent the length of the points, and the depth of thier inner corners.
//     The Depth% value is a scalar, a ratio of the outer radius, 0.5 is good for stars...play with this [0.1~~1.0]
//
//                           . ________________
//                                            ^
//                    .   .    .     .        |   Outer Radius
//                                            V
//                       .     ________________
//                                            V  Inner Radius (Depth#)
//                           .   ______________
//                      .          .
//
//
// --
    //   Rotate%, 360 degrees
    // --
//  A negative value for TextureID% will make the star that size, without an image.
//  eg ( TextureID%  = -5 ) will make the star 10 wide, radius 5...no skin.
// --
    //
// Other notes:
// Its midhandled.
// Use a square image, root 2
//
STATIC Phase%
LOCAL iW%, iH%, ViR#, VoR#
LOCAL VectorCount% = ( ( NumberOfPoints% * 2 ) + 2 )
LOCAL VectorAngleSize# = ( 180.0 / NumberOfPoints% ) * 1.0
LOCAL tX#, tY#, vX#, vY#

// Get the outer radius:
IF TextureID% >= 0
GETSPRITESIZE TextureID%, iW%, iH%
ViR# = ( iW% * 0.5 ) * Depth#
VoR# = ( iW% * 0.5 ) * 1.0
ELSE
VoR# = ABS(TextureID%) //use -textureid for a size param
ViR# = ( VoR# * Depth# )
ENDIF
//STAR:

STARTPOLY TextureID%, 0 // FAN Mode only!
POLYVECTOR x%, y%, VoR#, VoR#, Color# // center vector
LOCAL AngleNow#
FOR i% = 0 TO VectorCount% - 1
AngleNow# = ( ( VectorAngleSize# * i% * 1.0 ) + Rotate# ) * 1.0
Phase% = Phase% + 1
IF Phase% > 1
Phase% = 0
ENDIF
IF Phase%
vX# = COS( AngleNow# ) * VoR#
vY# = SIN( AngleNow# ) * VoR#
ELSE
vX# = COS( AngleNow# ) * ViR#
vY# = SIN( AngleNow# ) * ViR#
ENDIF
tX# = vX# + VoR#
tY# = vY# + VoR#
POLYVECTOR x% + vX#, y% + vY#, tX#, tY#, Color#
NEXT
ENDPOLY
RETURN 0
ENDFUNCTION


#39
 :good:
The string object lib i used, is up-to-date and ready to rock and roll.
Feel free to use it if you find handy, enjoy.
#40
i have a guess, the code will procrastinate  :good:
#41
Game on!
Compiled as a console program.
Note: only a few lines in main code, but what it does is pretty complicated.


Code (glbasic) Select
// --------------------------------- //
// Project: HelloWorld
// Start: Tuesday, March 12, 2019
// IDE Version: 15.238
// By Hemlos

// Instructions: compile as console

AUTOPAUSE FALSE
SYSTEMPOINTER TRUE

LOCAL HelloWorld AS lib_String_Object_
HelloWorld.is$ = "hElLo wOrLd"

LOCAL BGColor% = 0, TColor% = 15
STDCOLOR TColor,BGColor


STD_OUT( HelloWorld.is$ )
STD_OUT( HelloWorld._Capitalize$() )
STD_OUT( HelloWorld._Capwords$() )
STD_OUT( HelloWorld._Swapcase$() )
STD_OUT( HelloWorld._RFill$(3, "!") )
STD_OUT( HelloWorld._LFill$(3, "!") )
STD_OUT( HelloWorld._Left$(14) )
STD_OUT( HelloWorld._Right$(11) )
STD_OUT( HelloWorld._Swapcase$() )
STD_OUT( HelloWorld._Upper$() )
STD_OUT( HelloWorld._Lower$() )
STD_OUT( HelloWorld._Encrypt$("GLBasic") )
STD_OUT( HelloWorld._Decrypt$("GLBasic") )
STD_OUT( HelloWorld._Replace$("world","GLBasic") )
STD_OUT( HelloWorld._Replace$("GLBasic","world") )
STD_OUT( HelloWorld._Capitalize$() )
STD_OUT( HelloWorld._Capwords$() )


SLEEP 60000
END


FUNCTION STD_OUT: showThis$, restTimeMS% = 1000 // clearscreen, stdout, sleep. restTimeMS% = millseconds sleep time (integer) defaults one second
CLEARSCREEN
STDOUT "\n\n\n                            "
STDOUT showThis$
SLEEP restTimeMS%
RETURN 0
ENDFUNCTION


Include this String object library lib_String_Object.gbas :
QuoteThe message exceeds the maximum allowed length (20000 characters).
You'll have to download the .rar to see it in action.  :zzz:
Note: the string lib is mine own creation, based 100% on GLBasic command structures, and inspired by the Python Language.

#42
Quote from: Kitty Hello on 2019-Mar-09
Very cool. How do you come up with that kind of ideas?

I randomly study of math and astrophysics on a regular basis, using GLBasic to visualize some math.
I really wanted to see gravity in action, to see; stars, planets and moons form and take on unique orbits.
When i saw the formula for gravity from Isaac Newtons principia, i figured it could be worked out using a double nested loop.
Also, it has become a great platform for refining my 3d libs for cameras, particle engine, lighting, and sfx, etc etc
#43
Figgured it out..

MOUSEAXIS outputs are realtime, and you have to try and capture the output all through your program.
Even at the end of all nested loops.
What i mean is, MOUSEAXIS value can and does change several times between showscreen calls.

so i used this setup to capture the mouse output many times in the program loops:
function detectmouse
mX = MOUSEAXIS
self.CaptureX = mX

and then at the end of the main loop, just before the showscreen update the delta api mouse

function update_mouse
deltamouseX = CaptureX
delta stuff
CaptureX = 0 // RESET (showscreen should be next)
endfunction

ensure to reset the value so you can start capturing again, after the showscreen

#44
There is a space sandbox simulator if you really want that kind of effect with gas...saw it on youtube
tho it doesn't do accretion disks directly, you can immitate them by shredding stars lol

To answer your q's: yes and yes
basically, during system creation when the profile is chosen, it is an accretion disk engine at the beginning
gas? gas physics are present in the comets, the star pushes the gas tail away from the star.
planets form, its based on solids only, ice...rocks..solid. also....some gas are solid or liquid in deep space anyway, no atmospheres yet.
IRL most of the universe is made of hydrogen, doesn't make a good platform for planets.
supernovae create the higher density elements, and that is what these simulated objects represent, without regard to chemical properties and effects.

yes the disks can be formed into rings....every dimensional feature of an accretion is disk is covered if im not mistaking, but im not a scientist so, maybe i missed something.
Directly, it uses these features to form the solar systems:

Code (glbasic) Select

// SOLAR SYSTEM CONFIGURATION
GLOBAL SPLITWAVE = FALSE // Initial planet formation splits into 2 directions.
GLOBAL SPACEWAVEFORM% = 1 // 0 = direct VECTORADD addition, 1 = random VECTORADD addition ()
GLOBAL RINGS% = 12 // Number of rings
GLOBAL RADS% = 2 // # of radial hub arms
GLOBAL SPREAD# = 12.0 // additional rad spread random angle on xz plane
GLOBAL DIST# = 2000.0 // RADIUS OF PLANET BELT, PER STEP
GLOBAL GAP# = 8000.0 // Magnitude between each ring
GLOBAL G# = 0.000006674 // Gravitational constant - time, the bigger the constant, the faster time goes. our universe irl is very very slow, constant is tiny and thats a good thing.
//PLANET PHYSICS
GLOBAL STARSIZE# = 1000000000.0 // 0 = normal object >0 = star to form in center, size starts at this size.
GLOBAL MaxMASS# = 1100000.0 // RANDOM PLANET MASS MAX START SIZE
GLOBAL MinMASS# = 1000000.0 // RANDOM PLANET MASS MIN START SIZE
GLOBAL VECTORADD# = 0.0 // addition to SPACEWAVEFORM% angle of fall at initialization, 0 = stable, no variationss regardless of SPACEWAVEFORM%,
GLOBAL E# = 120.0 // solar system initial spin speed



Once the system is created and set into motion, its all Master Lord Sir Isaac Newtons Laws of motion in effect.
The algorithms he created and so beautiful, so beautiful they're compatible with computer code.
And to think he designed them 400 years ago without a calculator or computer is mind boggling.


[edit] it also has 3 cams, so far (these so tedious)
1 planet chase cam(not fixed, litteraly chases), 2 star tracking cam, and 3 freemouse cam
Freemouse cam also tracks with star, because it moves sometimes, quickly.
#45
Quote from: erico on 2019-Mar-01
<3 That is neat! Would it work better if the planet shading was more "hard", like a cartoon shade?
Looks awesome and I bet even better while moving about. :)
not sure, if it would or not?

heres a close up on the planets moving..
the ones on fire recently absorbed smaller things
the ones with trails (in this scene) are the smallest and original objects flying around, they take on color when they combine with something smaller, and lose the tails.