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.

Code Snippets / DBP Cloud Generator

Author
Message
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 18th May 2006 20:52
No media - just copy and paste for some nice fluffy clouds.





Oolite
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Middle of the West
Posted: 18th May 2006 21:40
Thats really nice, fast too!

Nice one Ric.
Mono
19
Years of Service
User Offline
Joined: 23rd May 2005
Location:
Posted: 18th May 2006 23:01
WOW, that's awesome!

Good job.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 19th May 2006 01:35
now THAT is nice!!!

[center]
Ianhfar
20
Years of Service
User Offline
Joined: 8th Jul 2004
Location: UK
Posted: 19th May 2006 10:33
Now thats a usefull snippet !
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 19th May 2006 14:12
Yep, simple, effective and realistic too!
sneaky smith12
18
Years of Service
User Offline
Joined: 30th Apr 2006
Location: Like id tell you, oh wait i just did
Posted: 20th May 2006 06:09
Very Impressive... A+

If at first you dont succeed, LOWER YOUR STANDARDS.
Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 21st May 2006 14:04
Awesome

Theme park simulator wip boards
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st May 2006 23:08
Quote: "nice fluffy clouds"


Indeed! And if they bring rain we'll all need some nice fluffy towels ...
Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 21st May 2006 23:52 Edited at: 22nd May 2006 00:05
Awesome got this imported into my stunt driving game

Edit:
How many object slots does thing use? I've setthenumber of clouds to 400 and all my object id's past 400 but still get a crash saying object already exsists

Theme park simulator wip boards
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 22nd May 2006 00:33
See your other post Chris - I've answered the question there fully - it uses a 'free_object()' function to assign ID's.

Thanks for the comments everyone.

Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 22nd May 2006 18:01
Thanks Ric i hit another thing which i posted there but this is awesome i'll get a screen of it in my game later

Theme park simulator wip boards
optical r
22
Years of Service
User Offline
Joined: 23rd Oct 2002
Location: Prime
Posted: 22nd May 2006 19:13 Edited at: 31st May 2006 13:12
truly remarkable, nice work as always ric!

[EDIT] MY SIG CONFORMS TO THE PROPOSED SIZE, PLEASE STOP DELETING!


Professional webdesigns available www.designrjs.com
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 22nd May 2006 20:07
its a great piece of code, however dont you think making a cloud image in photoshop or in an other program and then texturing a huge plain object above the camera with a texture scale with this image is a better option?

Too Sexy
TobiasWK
19
Years of Service
User Offline
Joined: 4th Sep 2005
Location: Denmark
Posted: 22nd May 2006 21:44
Very very nice... and its simple and good.
Thanks for the great snippet

Current projects:
FPS Multiplayer - 10% (making network code)
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 22nd May 2006 23:22
Quote: "dont you think making a cloud image in photoshop or in an other program and then texturing a huge plain object above the camera with a texture scale with this image is a better option?
"


Not really. Firstly, you need a very large, high res image to do that which takes up memory and slows things down. Secondly, every time it scrolls, the sky would be identical to the last time it scrolled. Thirdly, you would see hard edges at the edge of the plane, where it would look as if clouds were chopped in half. (Using fog on a large plane is no good either, as the fog distance varies with the angle between the camera and the plane).

This code however uses a tiny image, is always randomly changing, and fades nicely into the distance. Also, because each cloud in my code is at a different height, you get a 'parallax' effect which give the clouds more depth than you would get with one or two planes.

Azrael
19
Years of Service
User Offline
Joined: 2nd Mar 2005
Location: Germany
Posted: 23rd May 2006 13:53
Added to my favourite codes!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 23rd May 2006 14:00
try this:
attached media below..


Too Sexy

Attachments

Login to view attachments
optical r
22
Years of Service
User Offline
Joined: 23rd Oct 2002
Location: Prime
Posted: 23rd May 2006 17:07 Edited at: 23rd May 2006 17:13
Why use media for such a high fidelity look using code anyway? at 1024x768 res looks much better in terms opf rivalling a prerendered image

[EDIT]ignore


Professional and comprehensive webdesigns available on request www.designrjs.com
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 23rd May 2006 19:33 Edited at: 23rd May 2006 19:34
i didnt say its a bad code, the code is awesome by Ric. he always gives the best out to the community and personally i learnt alot from him.
my point is, using media, you have chance to work in more detail, rather than box made and blurred smoke images. and as well, you have 2 polygons per cloud layer(in my version)a total of 4 polygons rather than 400x2 = 800 polygons(in Rics version) which approximately 300-400 of those are visible on the screen with a 90 Degree FOV.
Add
in both versions and see the difference.
now before you can compare you have to delete the matrix code out of my version, which you just cant understand the difference because of the matrix. and tell me your screen fps and polygon count.
after all, if you are gonna use it for a big project which will involve alot of objects later on, you wouldnt really want to spend 400 objects for clouds only.
Regards

Too Sexy
Carolina South
20
Years of Service
User Offline
Joined: 28th Sep 2004
Location: South Carolina
Posted: 24th May 2006 21:24
@ CuCuMBeR

How do I get rid of the 'wireframe' tha appears when your code is used?

I don't see a set wireframe on command in there...

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock." - Will Rogers

"The secret to creativity is knowing how to hide your sources." - Albert Einstein
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 24th May 2006 21:30
that wireframe is a matrix
just delete the matrix creation code and make it look like this


Too Sexy
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 25th May 2006 01:49 Edited at: 25th May 2006 03:41
Great stuff there Ric!

Here's my version:





[Edit]

Personally though, this is the way I would code it... I don't like the idea of getting a free seed object, then not check if the rest are free, so this uses arrays. This also means each cloud can be controlled seperatelly.

A few more changes:
The color of the clouds can be changed, and the clouds always respawn back to the front, so they always follow you.



That just feels more comfy with me, heh.

Carolina South
20
Years of Service
User Offline
Joined: 28th Sep 2004
Location: South Carolina
Posted: 25th May 2006 18:04
Thanks CuCuMBeR. I must be blind sometimes

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock." - Will Rogers

"The secret to creativity is knowing how to hide your sources." - Albert Einstein

Login to post a reply

Server time is: 2024-11-23 03:20:43
Your offset time is: 2024-11-23 03:20:43