| | Help .!!! Demande Ciel aléatoire | |
| | Author | Message |
---|
Findescarrotte +1000
Number of posts : 1956 Registration date : 2007-06-19
| Subject: Help .!!! Demande Ciel aléatoire Fri 28 Mar - 13:31 | |
| Help .!!! Demande Ciel aléatoire .. La demaine est comme le titre hein , voila je voudrais faire et cela dans le cadre de mon projet encourt avoir dans ( le , les ) mondes un ciel aléatoire .. Le Ciel serait pour commancer de jour et passe a couher du soleil par nuit et revient a celui de jour ! Cette gestion serait aléatoire en temps , c'est a dire au bout de 10 minutes le ciel change sur le deuxième lentement et continue comme cela . Le ciel Background serait composer de ses codes 1°) Jour - Code:
-
Background { groundAngle [ .1, 1.309, 1.571 ] groundColor [ 0 0 0, 0 .1 .3, 0 .2 .5, 0 .3 .8 ] skyAngle [ .1, .15, 1.309, 1.571 ] skyColor [ .4 .4 .1, .4 .4 .1, 0 .1 .3, 0 .2 .6, .8 .8 .8 ] } 2°) coucher du soleil - Code:
-
Background { skyAngle [ 1.1, 1.4, 1.57 ] skyColor [ .333 .118 .118, .333 .118 .118, .706 .392 .235, .941 .863 .392 ] groundAngle [ 1.4, 1.57 ] groundColor [ .863 .549 .235, .863 .549 .235, .627 .275 .157 ] }
3°) Nuit - Code:
-
Background { skyColor [ 0 0 0, .118 .392 .627, 0 .2 .4 ] skyAngle [ 1.309, 1.571 ] groundColor [ 0 0 0, .118 .392 .627, 0 .2 .4 ] groundAngle [ 1.309, 1.571 ] }
C'est l'idée un cicle de 30 minutes avec un ciel aléatoire , avec des images ,je ne pence pas que c'est possible , mais avec des codes ca pourrait le faire. Quand je dit aléatoire , je ne veus pas de hud pour le changer nous même a la main , non cela dois ce faire automatiquement , il y a surment un scripte ou proto ? une manière de faire cette gestion ! | |
| | | alain fondateur
Number of posts : 23529 Localisation : Dompierre sur Veyle ,France Registration date : 2005-04-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Fri 28 Mar - 14:06 | |
| chez Phantasico ....
et quelques autres | |
| | | Findescarrotte +1000
Number of posts : 1956 Registration date : 2007-06-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Fri 28 Mar - 16:36 | |
| Merci alain ! J'ai été sur le site Phantasico , j'y avais jamais été , oufffttiii le world , super beau et réaliste .! Franchement un super boulot .! J'ai bien aimer tout l'ensemble , même si le FPS était un peut bas magrés ma bonne carte video ben j'ai donc regarder l'enviromenent du ciel , c'est bien ce genre de chose qui m'intèresse , j'ai donc regarder la source , et la aussi ouffttiii la aussi le , les proto utiliser .. C'est du béton .! Je vais donc utiliser la source proto dans mon projet et notifier le nom du world Phantasico.de Je vais donc associer ce ciel et faire un teste de FPS ! c'est une chose que je regarde souvent pour ne pas laguer.! | |
| | | alain fondateur
Number of posts : 23529 Localisation : Dompierre sur Veyle ,France Registration date : 2005-04-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Fri 28 Mar - 18:39 | |
| bêtement j'avais pas cité hermetic , il en a un aussi
may be sim city aussi etc ..
je vais te dire un truc , mais pas pour t'embêter , hein , lol
moi l'idée qui m'avait plue c'est que les gens rentrent la nuit s'il fait nuit chez eux ( par exemple un ricain côte ouest ) alors qu'un autre ( par ex un french ) rentre de jour s'il fait jour chez lui
je ne me souviens plus s'il quelqu'un l'a fait , vi même si j'avais trouvé la soulution , c'es mon altzeimer LOL | |
| | | Fersen +200
Number of posts : 441 Age : 46 Registration date : 2007-12-22
| Subject: Re: Help .!!! Demande Ciel aléatoire Fri 28 Mar - 20:16 | |
| Si ça a existé Alain, d'abord sur le deuxième monde et ensuite je crois avec Lutèce. Par contre ça devait être par rapport à l'heure du serveur et pas en fonction du décalage horaire de chacun. Peut-être Meri pourrait nous confirmer le truc. | |
| | | alain fondateur
Number of posts : 23529 Localisation : Dompierre sur Veyle ,France Registration date : 2005-04-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Fri 28 Mar - 20:26 | |
| ah LOL Fersen , prendre l'heure de l'ordi OK , mais là je m'étais ..pris la tête avec cette idée de décalages horaires , c'était à l'époque où yavait des chats 3d et où j'avais des copines au delà des mers ahahahah hey Fersen , rate pas le spip / mixed , et je crois que t'avais ratées les 3 -4 photos des 6A pour yellow submarine J'ai des peintures des 4D , je ferai quelques photos | |
| | | Findescarrotte +1000
Number of posts : 1956 Registration date : 2007-06-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Fri 28 Mar - 21:10 | |
| J'ai opter pour le magnifique Ciel Phantasico , je perts un peus de FPS a cause des deux sphere , l'animation qui tourne , mais pas de trop .. , temp dit que un Background simple a beaucoup moins de polygones et donc bon pour le fps
Ben si je trouve une autre solution , je verais une mise a jour . | |
| | | legloups +200
Number of posts : 678 Localisation : var Registration date : 2006-05-05
| Subject: Re: Help .!!! Demande Ciel aléatoire Sat 29 Mar - 19:03 | |
| Autrement tu avais ce système qui était pas mal, si je me souviens bien, il marche nickel sous Cortona, et je sais plus pour BS (à vérifier)... Bon par contre je me souviens plus où je l'avais récupéré... Le proto : - Code:
-
PROTO Sunlight [ field SFBool autoClock TRUE field SFBool live TRUE field SFBool useDay TRUE field SFTime duration 5 field SFInt32 hour 12 field SFInt32 minute 0 field SFInt32 second 0 exposedField MFNode children [] ]{
PROTO local_ColorArrayInterpolator [ eventIn SFFloat set_fraction eventIn MFFloat set_key eventIn MFColor set_keyValue field MFFloat key [] field MFColor keyValue [] eventOut MFFloat key_changed eventOut MFColor keyValue_changed eventOut MFColor value_changed ] { Script { field SFString copyright "Copyright (c) 1999, Braden N. McDaniel" eventIn SFFloat set_fraction IS set_fraction eventIn MFFloat set_key IS set_key eventIn MFColor set_keyValue IS set_keyValue field MFFloat key IS key field MFColor keyValue IS keyValue field SFBool validValues FALSE eventOut MFFloat key_changed IS key_changed eventOut MFColor keyValue_changed IS keyValue_changed eventOut MFColor value_changed IS value_changed url ["javascript:
function interpolateColor(sfcolor1, sfcolor2, intermediateFraction) { return new SFColor(sfcolor1.r + ((sfcolor2.r - sfcolor1.r) * intermediateFraction), sfcolor1.g + ((sfcolor2.g - sfcolor1.g) * intermediateFraction), sfcolor1.b + ((sfcolor2.b - sfcolor1.b) * intermediateFraction)); } function getKeyMinIndex(fraction) { var index = 0; while (((index + 1) < key.length) && (key[index + 1] < fraction)) { index++; } return index; } function getIntermediateFraction(keyMinIndex, fraction) { var intervalDifference = (key[keyMinIndex + 1] - key[keyMinIndex]); var intervalElapsed = (fraction - key[keyMinIndex]); return (intervalElapsed / intervalDifference); } function initialize() { if ((key.length >= 2) && ((keyValue.length % key.length) == 0)) { validValues = true; } else { validValues = false; } } function set_fraction(value) { value_changed = new MFColor(); if (validValues) { var arraySize = (keyValue.length / key.length); var keyMinIndex = getKeyMinIndex(value); var valueStartIndex = keyMinIndex * arraySize; var intermediateFraction = getIntermediateFraction(keyMinIndex, value); if (value == key[keyMinIndex]) { for (var i = 0, j = valueStartIndex; i < arraySize; i++, j++) { value_changed[i] = keyValue[j]; } } else { for (var i = 0, j = valueStartIndex; i < arraySize; i++, j++) { value_changed[i] = interpolateColor(keyValue[j], keyValue[j + arraySize], intermediateFraction); } } } } function set_key(value) { key_changed = key = value; initialize(); } function set_keyValue(value) { keyValue_changed = keyValue = value; initialize(); }
"] } }
Group { children [
Group { children [ DEF LIGHT DirectionalLight { direction 1 0 0 } Group { children IS children } ] }
DEF COLOR ColorInterpolator { # nite, morn, noon, even, night, night key [ 0, .166, .333, .5, .666, 1] keyValue [.3 .3 .4, .8 .9 1, 1 1 .9, 1 .8 .6, .4 .3 .3, .2 .2 .25] }
DEF BRITE ScalarInterpolator { # nite, morn, noon, even, night, night key [ 0, .166, .333, .5, .666, 1] keyValue [0, .8, 1, .8, 0, 0] }
DEF BG Background { skyColor [ .000 .000 .000, .001 .009 .029, .014 .061 .185, .006 .026 .166, .001 .013 .091 ] skyAngle [.7, 1.6, 1.8, 2] }
DEF ATMOS local_ColorArrayInterpolator { # nite, morn, noon, even, night, night key [ 0, .166, .333, .5, .666, 1] keyValue [ .000 .000 .000, .001 .009 .029, .014 .061 .185, .006 .026 .166, .001 .013 .091, .001 .201 .706, .019 .708 .901, .864 .681 .497, .863 .349 .219, .755 .199 .087, .012 .350 .995, .012 .576 .995, .395 .785 .894, .812 .893 .884, .900 .900 .900, .041 .570 .455, .071 .426 .761, .485 .262 .812, .864 .027 .341, .875 .078 .042, .000 .000 .000, .001 .009 .029, .014 .061 .185, .006 .026 .166, .001 .013 .091, .000 .000 .000, .001 .009 .029, .014 .061 .185, .006 .026 .166, .001 .013 .091 ] }
DEF TICK TimeSensor { loop TRUE cycleInterval IS duration }
DEF SUN Script { eventIn SFFloat update eventOut SFFloat fraction_changed eventOut SFVec3f direction_changed
field SFBool autoClock IS autoClock field SFBool live IS live field SFBool useDay IS useDay field SFInt32 h IS hour field SFInt32 m IS minute field SFInt32 s IS second field SFFloat PIPI 6.283185307179586476925286766559
url ["javascript: function initialize() { increment(0); }
function update(val) { if (live) { increment(val); } }
function increment(val) { setTime(); var fraction = useDay ? getFraction() : val; fraction_changed = fraction; direction_changed = new SFVec3f(Math.cos(PIPI * fraction), -Math.sin(PIPI * fraction), 0); }
function setTime() { if (autoClock) { var now = new Date(); h = now.getHours(); //need to work on 24 clock - add 12 if pm m = now.getMinutes(); s = now.getSeconds(); } else { s ++; if(s > 59) { s = 0; m++; } if(m > 59) { m = 0; h++; } if(h > 23) { h = 0; } } }
function getFraction() { var sness = s / 60; var mness = (m + sness) / 60; var dness = (h + mness) / 24; return dness; }
"]
} ] }
ROUTE TICK.fraction_changed TO SUN.update ROUTE SUN.direction_changed TO LIGHT.set_direction ROUTE SUN.fraction_changed TO COLOR.set_fraction ROUTE COLOR.value_changed TO LIGHT.set_color ROUTE SUN.fraction_changed TO BRITE.set_fraction ROUTE BRITE.value_changed TO LIGHT.set_intensity ROUTE SUN.fraction_changed TO ATMOS.set_fraction ROUTE ATMOS.value_changed TO BG.set_skyColor } Pour l'apeller : - Code:
-
EXTERNPROTO Sunlight [ field SFBool autoClock field SFBool live field SFBool useDay field SFTime duration field SFInt32 hour field SFInt32 minute field SFInt32 second exposedField MFNode children ] "SunlightPROTO.wrl#Sunlight"
NavigationInfo { headlight FALSE type ["EXAMINE", "ANY"] }
Viewpoint { position 1 2 8 orientation 1 0 0 -.2 }
Sunlight { useDay FALSE autoClock FALSE duration 15 children [ Inline { url "meadow.wrl" } ] } | |
| | | Findescarrotte +1000
Number of posts : 1956 Registration date : 2007-06-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Sun 30 Mar - 1:17 | |
| Génial legloups merci !!! mais dit moi , tu ne sais pas , ou vraiment plus d'ou viens la source , ce que contenais le fichier ( meadow.wrl ) car c'est important pour tester . | |
| | | alain fondateur
Number of posts : 23529 Localisation : Dompierre sur Veyle ,France Registration date : 2005-04-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Sun 30 Mar - 2:16 | |
| http://www.google.fr/search?hl=fr&q=SunlightPROTO&meta=
héhé heureusement que j'ai de la mémoire malgré mon alzeitmer
hihih
http://accad.osu.edu/~pgerstma/protolib/Sunlight/
http://accad.osu.edu/~pgerstma/protolib/Sunlight/meadow.wrl | |
| | | alain fondateur
Number of posts : 23529 Localisation : Dompierre sur Veyle ,France Registration date : 2005-04-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Sun 30 Mar - 2:23 | |
| moi ça ma met une erreur pour - Code:
-
field SFFloat PIPI 6.283185307179586476925286766559 mais je me souviens je crois , que quand j'avais joué avec ce truc j'ai mis - Code:
-
field SFFloat PIPI 6.28 et ça allait mieux | |
| | | Findescarrotte +1000
Number of posts : 1956 Registration date : 2007-06-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Sun 30 Mar - 11:54 | |
| Hhahah ! Alain la bibliothèque WRL | |
| | | legloups +200
Number of posts : 678 Localisation : var Registration date : 2006-05-05
| Subject: Re: Help .!!! Demande Ciel aléatoire Sun 30 Mar - 12:02 | |
| Heureusement qu'il y en a qui en a au moins un qui a de la mémoire... Et en plus des solutions... | |
| | | alain fondateur
Number of posts : 23529 Localisation : Dompierre sur Veyle ,France Registration date : 2005-04-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Sun 30 Mar - 12:07 | |
| bah je l'avais bidouillé ici
http://dumenieu.free.fr/vrml/yeats/loadyeatsmp3skip.wrl
pour ça que je m'en souviens
..tellement de bidouillages d'ailleurs , là dedans , que ça rame un max LOL | |
| | | Findescarrotte +1000
Number of posts : 1956 Registration date : 2007-06-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Sun 30 Mar - 12:29 | |
| je l'ai tester sur mon projet , j'ai du également placer en field SFFloat PIPI 6.28 pour que cela fonctionne , mais ouffttti le cicle , il est rapide ! | |
| | | alain fondateur
Number of posts : 23529 Localisation : Dompierre sur Veyle ,France Registration date : 2005-04-19
| Subject: Re: Help .!!! Demande Ciel aléatoire Sun 30 Mar - 12:32 | |
| le cycle se règle ici - Code:
-
Sunlight { useDay FALSE autoClock FALSE duration 15 ........................................................................... children [ Inline { url "meadow.wrl" } ] } | |
| | | Sponsored content
| Subject: Re: Help .!!! Demande Ciel aléatoire | |
| |
| | | | Help .!!! Demande Ciel aléatoire | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |