Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / (DBPRO) - USsinga scaled sphere and a texture to produce a simple but cool visual effect

Author
Message
Starshyne Emir
7
Years of Service
User Offline
Joined: 27th Nov 2016
Location: Porto Alegre, southern Brazil
Posted: 23rd Mar 2018 10:04
This is something that someone can use to produce a simple but cool effect for a background or whatever.

It is fairly simple: a small texture is applied and scaled on a sphere that is flattened to become a disk, and then scrolled around to make the magic.

´code]
SYNC ON : SYNC RATE 60
DO
CLS

SC = RND(5)+3
W = RND(5)+2 : H = RND(8)+3
C = 0 : CLIMIT = RND((W*H)/3) + ((W*H)/4)

REPEAT
X = RND(W)+1
Y = RND(H-1)+2
DOT X,Y
INC C
Until C = 10
GET IMAGE 1,1,1,W,H,1


MAKE OBJECT SPHERE 1,30
SET OBJECT CULL 1,0
SET OBJECT TEXTURE 1,1,1
SET OBJECT LIGHT 1,0
TEXTURE OBJECT 1,1
SET OBJECT TRANSPARENCY 1,1
SCALE OBJECT TEXTURE 1,SC,1
SCALE OBJECT 1,100,0,100

PITCH OBJECT UP 1,90

COLOR BACKDROP 0
TURN# = 0.01 * (RND(5) - RND(5))
ZOOM# = 0.01 * (RND(5) - RND(5))

REPEAT
SCROLL OBJECT TEXTURE 1,TURN#,ZOOM#
SYNC

UNTIL SPACEKEY() = 1
DELETE OBJECT 1
DELETE IMAGE 1
Loop


This example is fairly self-explanative. Just press SPACEBAR to shift between the thousands of possible effect layouts.

If someone has some ideas to improve it, feel free to share them down below.
[size=+2]Forever and one[/size]
sman512
9
Years of Service
User Offline
Joined: 28th Nov 2014
Location: Russia
Posted: 23rd Mar 2018 19:22
Awesome!
GS
Starshyne Emir
7
Years of Service
User Offline
Joined: 27th Nov 2016
Location: Porto Alegre, southern Brazil
Posted: 27th Mar 2018 14:58
Really? Whoa, thanks!
[size=+2]Forever and one[/size]
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 28th Mar 2018 02:19
Good job. This inspires me to make loading animations in apps.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 28th Mar 2018 03:17
Wow, that really makes some cool effects with so few lines! Just messing around, I added a little color to the mix. I simply added the random ink rgb line here:



So many games to code.....so little time.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 28th Mar 2018 06:25
Quote: " I simply added the random ink rgb line here:"


nice one.

It is impressive how many different effects this produces.
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Dimis
12
Years of Service
User Offline
Joined: 12th Jun 2011
Location: Athens, Hellas
Posted: 28th Mar 2018 18:08
Wow, impressive! Truly, the possibilities are endless.

Login to post a reply

Server time is: 2024-04-25 08:39:54
Your offset time is: 2024-04-25 08:39:54