The Game Creators
The Game Creators Home Online Shop Click to Login
  Hot: Christmas CompetitionNovember NewsletterModel Pack 36DB Pro Pack 2009DGS BonanzaCharacter PackFPS Creator Bonanza;
The Game Creators
Code Snippets / Jelly Morpher Thing

Go to the first page of this board Return to the Forum Menu Post Message
9 Messages - Page   of 1   
Bookmark and Share Search the Forum

Author Message
Ric

User


Joined: Sun Jul 11th 2004
Location: object position x
Posted: 3rd Jan 2005 16:41     Edited: 7th Feb 2005 02:23     | link | toggle

Make your screen go all wobbly!

+ Code Snippet
`*** Jelly Physics by Ric ***


sync on:sync rate 40:autocam off:hide mouse:color backdrop 0

make object sphere 1,1
color object 1,rgb(255,0,0)
position object 1,-2,0,0
make object cone 2,0.8
color object 2,rgb(0,255,0)
position object 2,0,0,-2
make object cube 3,1
color object 3,rgb(0,0,255)
position object 3,2,0,0
position camera 0,0,-5
sync
get image 1,0,0,screen width(),screen height(),1
delete object 1
delete object 2
delete object 3

omega#=1.0
amp#=20.0
rows=50
columns=50
elasticity#=0.004
damping#=0.99
a=15
b=10

position camera rows/2,50,columns/2
yrotate camera -90
point camera rows/2,0,columns/2

num=rows*columns
dim obnum(rows+1,columns+1)
dim v#(rows,columns)
make matrix 1,rows,columns,rows,columns
for x=1 to rows
for z=1 to columns
obnum(x,z)=ob
ob=ob+1
next z
next x
prepare matrix texture 1,1,rows,columns
tile=1
for x=rows-1 to 0 step -1
for z=0 to columns-1
set matrix tile 1,z,x,tile
inc tile
next z
next x

do

y#=amp#*sin(theta#)
theta#=theta#+2
set matrix height 1,a,b,y#
for x=1+1 to rows-1
for z=1+1 to columns-1
if x<rows
distxp1#=get matrix height(1,x+1,z)-get matrix height (1,x,z)
endif
if x>1
distxm1#=get matrix height(1,x-1,z)-get matrix height (1,x,z)
endif
if z<columns
distzp1#=get matrix height(1,x,z+1)-get matrix height (1,x,z)
endif
if z>1
distzm1#=get matrix height(1,x,z-1)-get matrix height (1,x,z)
endif
vectorsum#=distxp1#+distxm1#+distzp1#+distzm1#
a#=vectorsum#*elasticity#
v#(obnum(x,z))=v#(obnum(x,z))+a#
set matrix height 1,x,z,get matrix height(1,x,z)+v#(obnum(x,z))
v#(obnum(x,z))=v#(obnum(x,z))*damping#
next z
next x
update matrix 1
sync

loop




Back to top
Andromedus.com
Report this message as abusive
TEH_CODERER

User


Joined: Wed Nov 12th 2003
Location: Right behind you!
Posted: 3rd Jan 2005 17:27           | link | toggle

Simple but effective.

Realms Of Tutopia I : Rise Of Evil - A hack+slash RPG
http://www.freewebs.com/elbsoftware/index.htm
Back to top
Report this message as abusive
Essence

User


Joined: Sat Oct 12th 2002
Location: The Netherlands
Posted: 4th Jan 2005 01:51           | link | toggle

Nice for underwater effect
Back to top
Report this message as abusive
Ric

User


Joined: Sun Jul 11th 2004
Location: object position x
Posted: 4th Jan 2005 04:11     Edited: 7th Feb 2005 02:23     | link | toggle

Good point - hadn't thought of that. Code title should now read 'Dynamic optical refraction modelling'.


Back to top
Andromedus.com
Report this message as abusive
Google Ad
Back to top
 
Maleck

User


Joined: Wed May 12th 2004
Location: US
Posted: 5th Jan 2005 00:55           | link | toggle

Thanks for throwing this together. It may help with a distortion effect I was wanting to try.
Back to top
Report this message as abusive
ALPHA ZERO PRODUCTIONS

User


Joined: Sun Sep 28th 2003
Location: Mom ! I forgot where we live !
Posted: 5th Jan 2005 06:10           | link | toggle

screenshot please

NEW WEBSITE ONLINE (best viewed with FireFox)
XboxLive Gamertag: AZP
Back to top
Send AIM user a message
Report this message as abusive
Phaelax

User


Joined: Wed Apr 16th 2003
Location: Ohio
Posted: 5th Jan 2005 21:40           | link | toggle

neato

"eureka" - Archimedes
Back to top
Zimnox Find user on ICQ Send AIM user a message
Report this message as abusive
Jbolts1

User


Joined: Sat Jan 1st 2005
Location: Cyberspace
Posted: 13th Jan 2005 03:46           | link | toggle



Jbolt
Back to top
Level Plans
Report this message as abusive
Ric

User


Joined: Sun Jul 11th 2004
Location: object position x
Posted: 7th Feb 2005 02:22           | link | toggle

Hey - I got into the newsletter with this!! Woohoo!


Back to top
Andromedus.com
Report this message as abusive

Go to the first page of this board Return to the Forum Menu Post Message
9 Messages - Page   of 1   
Search the Forum

Sorry, but it has been so long since anyone replied to this Thread that it has been automatically locked.
You may read it but not reply.

Forum Search

Enter a word or phrase to search our Forum for:

Thread Subject Search
Search Phrase:
Search Scope: Entire forum
Just this board
 
Google Forum Search
Search Phrase:
 
Apollo v2.02


Game Creator Store
Privacy Policy AUP Top of Page