| [Script] Système d'ombre | |
|
+4gohu8 Ragdoll [TheDarkTiger] M@d_Doc 8 participants |
Auteur | Message |
---|
M@d_Doc Modérateur
![M@d_Doc](https://2img.net/u/3412/18/80/54/avatars/7-77.png)
Messages : 6600 Localisation : 47°44'8.04 Projet Actuel : aucun
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: [Script] Système d'ombre Dim 26 Aoû 2007 - 22:10 | |
| A mettre dans le draw de l'objet qui doit faire l'ombre. Ici, c'est l'objet light qui sert de référence au moteur pour savoir ooù il y a de la lumière.... - Code:
-
for (xx=0;xx<=room_width+110;xx+=110) for (yy=0;yy<=room_height+110;yy+=110) {{ rayon=175; color=c_black;
alpha=(point_distance(xx,yy,instance_nearest(xx,yy,light).x,instance_nearest(xx,yy,light).y)-100)/100 if alpha>1 {alpha=1} draw_primitive_begin(pr_trianglefan); draw_vertex_color(xx,yy,color,alpha); for(i=0; i<=360; i+=360/9) { draw_vertex_color(xx+lengthdir_x(rayon,i),yy+lengthdir_y(rayon,i),color,0); } draw_primitive_end();
}} A près, on peux régler pour mettre une ombre plus détaillée, mais ça bouffe assez de RAM comme ça.... |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
[TheDarkTiger] Modérateur
![[TheDarkTiger]](https://2img.net/u/3412/18/80/54/avatars/78-67.gif)
Messages : 7420 Localisation : Essonne
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Dim 26 Aoû 2007 - 23:14 | |
| vraiment sympa comme truc !
et simple à implanter.
chapeau ! |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
M@d_Doc Modérateur
![M@d_Doc](https://2img.net/u/3412/18/80/54/avatars/7-77.png)
Messages : 6600 Localisation : 47°44'8.04 Projet Actuel : aucun
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Dim 26 Aoû 2007 - 23:16 | |
| C'est le système de The Silencer ![super](/users/3412/18/80/54/smiles/684630.png) |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Ragdoll *Excellent utilisateur*
![Ragdoll](https://2img.net/u/3412/18/80/54/avatars/95-74.png)
Messages : 5494 Localisation : Angers, maine et loire Projet Actuel : Rien je suis mort a l'intérieur.
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Lun 27 Aoû 2007 - 12:08 | |
| merci, je teste :coeur2: EDIT : c' est trés joli, mais je ne comprend pas prk il genere des points de lumiere a certains endroit de la room (en tout cas c' est l' effet que ça donne) ![:question: ❓](https://cdn.jsdelivr.net/emojione/assets/png/2753.png?v=2.2.7) |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
gohu8 Utilisateur confirmé: Rang ****
![gohu8](https://2img.net/u/3412/18/80/54/avatars/574-60.jpg)
Messages : 832 Localisation : A Black Mesa
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Lun 27 Aoû 2007 - 12:29 | |
| c'est dommage, ça me fait ça (c'est pour l'ombre du mitraillette): ERROR in action number 1 of Draw Event for object mitrailleuse: Error in code at line 7: alpha=(point_distance(xx,yy,instance_nearest(xx,yy, light).x,instance_nearest(xx,yy,light).y)-100)/100 at position 53: Unknow variable light. C'est quoi le prob ![:question: ❓](https://cdn.jsdelivr.net/emojione/assets/png/2753.png?v=2.2.7) |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
edi9999 Utilisateur confirmé: Rang *****
![edi9999](https://2img.net/u/3412/18/80/54/avatars/288-99.jpg)
Messages : 2480 Localisation : France Projet Actuel : theatre flashy
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Lun 27 Aoû 2007 - 12:33 | |
| il faut que tu crée un objet light
Sinon vraiment joli ton effet d ombre |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
gohu8 Utilisateur confirmé: Rang ****
![gohu8](https://2img.net/u/3412/18/80/54/avatars/574-60.jpg)
Messages : 832 Localisation : A Black Mesa
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Lun 27 Aoû 2007 - 14:20 | |
| elle est valable que dans le register version encore une fois ![triste](/users/3412/18/80/54/smiles/532783.png) |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Topaze22 *Excellent utilisateur*
![Topaze22](https://2img.net/u/3412/18/80/54/avatars/709-56.jpg)
Messages : 6213 Localisation : Sur la Lune Projet Actuel : Projet HELLO/TOPAZE22 Mario Bros World
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Mer 29 Aoû 2007 - 3:53 | |
| J'y comprends pas grand chose, je pourrais avoir un screen afin que je vois l'effet ? SVP :-D |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Ragdoll *Excellent utilisateur*
![Ragdoll](https://2img.net/u/3412/18/80/54/avatars/95-74.png)
Messages : 5494 Localisation : Angers, maine et loire Projet Actuel : Rien je suis mort a l'intérieur.
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Mer 29 Aoû 2007 - 10:27 | |
| ben chez moi ça rend bizarre : ![[Script] Système d'ombre 13ivcx3.th](https://2img.net/r/ihimizer/img443/205/13ivcx3.th.png) au lieu que la source de lumiere soit sur le herso (le rond noir) il est sur a certains endroits fixes de la room (la, au dessus et en dessous du héros), c' est normal ? |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
M@d_Doc Modérateur
![M@d_Doc](https://2img.net/u/3412/18/80/54/avatars/7-77.png)
Messages : 6600 Localisation : 47°44'8.04 Projet Actuel : aucun
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Mer 29 Aoû 2007 - 10:51 | |
| en fait, dans le create du héros, fait : self.L=instance_create(x,y,light) Comme ça, tu pourra toujours appeler la lumière de ton perso... Dans step tu rajoute : self.L.x=x self.L.y=y et la light suivra ton perso..... |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Ragdoll *Excellent utilisateur*
![Ragdoll](https://2img.net/u/3412/18/80/54/avatars/95-74.png)
Messages : 5494 Localisation : Angers, maine et loire Projet Actuel : Rien je suis mort a l'intérieur.
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | |
![Aller en bas](https://2img.net/i/empty.gif) | |
M@d_Doc Modérateur
![M@d_Doc](https://2img.net/u/3412/18/80/54/avatars/7-77.png)
Messages : 6600 Localisation : 47°44'8.04 Projet Actuel : aucun
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Mer 29 Aoû 2007 - 11:32 | |
| montre le .gm6, parce que je vois pas là.... |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
daminetreg Administrateur
![daminetreg](https://2img.net/u/3412/18/80/54/avatars/6-29.png)
Messages : 16998 Localisation : Siege du CBNA! Projet Actuel : Site Web du CBNA, version beta :
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Ven 31 Aoû 2007 - 19:04 | |
| En tous cas bon script, il marche impec. ![happy1](/users/3412/18/80/54/smiles/922323.png) |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Innoson Utilisateur confirmé: Rang ****
Messages : 927 Projet Actuel : Aller voir la bas si jy suis.
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre Mer 5 Sep 2007 - 20:58 | |
| - Jango_Fett a écrit:
- ben chez moi ça rend bizarre :
![[Script] Système d'ombre 13ivcx3.th](https://2img.net/r/ihimizer/img443/205/13ivcx3.th.png) au lieu que la source de lumiere soit sur le herso (le rond noir) il est sur a certains endroits fixes de la room (la, au dessus et en dessous du héros), c' est normal ? arf les couleur de l'ombre son inversé lol |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
Contenu sponsorisé
![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | Sujet: Re: [Script] Système d'ombre ![[Script] Système d'ombre Empty](https://2img.net/i/empty.gif) | |
| |
|
![Aller en bas](https://2img.net/i/empty.gif) | |
| [Script] Système d'ombre | |
|