//From an original idea of Johanna Hyacinth (see profile in world and her web site : http://johannahyacinth.blogspot.com but by script. //Droits et propriété intellectuelle //Tout le contenu du script est au-delà du domaine public. Vous pouvez le copier, l'offrir et le donner et même, si vous en avez le fantasme, le mettre carrément à la poubellle. //Si vous y apportez des modifications, faites-en profiter la communauté. //Et je dirais même plus, si vous voulez faire croire que vous en êtes l'auteur, ça ne m'empêchera pas de dormir. //Rights and intellectual property. //All the script content is beyond the public property. You can copy it, offer it, and give it and even, if you have a fantasy, throw it to the bin. //If you modify it, let take advantage to the community. //And, to be more specific, if you want to take somebody in you are the author, I won't lose any sleep over it. //Garmin Kawaguichi //This script transforms a prim standard box into a flat 5 faces panel; it uses the llSetPrimitiveParams function with specific parameters. // The followings are the successive steps to obtain this result: //1.- PRIM_TYPE, PRIM_TYPE_PRISM, 0, <0.2, 0.8, 0.0>, 0.65, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>: a prism with Path Cut B = 0.2 and E = 0.8; Hollow to 65; Taper X and Y = 0; Size X and Y = 1.0 //2. - PRIM_SIZE, <0.01, ((float)imgWidth / (float)imgHeight) * 6.0, 1.0>: the prim size sets to X = 0.01, Y = Z * 6 * (image width / image height), Z = line of screens height; but keep in memory that Y and/or Z are limited to 10 meters, if the rate between width and height is 1.333333 (for a 640x480 picture), the maximum value for Z is 1.25 //3. - From left to right the face numbers are: 3, 7, 4, 6, and 1; but the texture parameters for faces 3, 4, and 1 need to be adjusted: (the texture UUID 5748decc-f629-461c-9a36-a35a221fe21f is the white standard one) //Face 3 - PRIM_TEXTURE, 3, "5748decc-f629-461c-9a36-a35a221fe21f", <2.5, 1.0, 0.0>, <-0.25, 0.0, 0.0>, 0.0 => Hor repeat = 2.5; vert repeat = 1.0; hor offset = -0.250 //Face 4 - PRIM_TEXTURE, 4, "5748decc-f629-461c-9a36-a35a221fe21f", <-15.4, 1.0, 0.0>, <-0.2, 0.0, 0.0>, 0.0 => Hor repeat = 15.4 flipped; vert repeat = 1.0; hor offset = -0.200 //Face 1 - PRIM_TEXTURE, 1, "5748decc-f629-461c-9a36-a35a221fe21f1", <2.5, 1.0, 0.0>, <0.25, 0.0, 0.0>, 0.0 => Hor repeat = 2.5; vert repeat = 1.0; hor offset = 0.250 //Faces coloring; to return to white for a normal use //PRIM_COLOR, 5, <1.0, 0.0, 1.0>, 1.0 => the RGB colors are chosen from the face number (5 = 101, 7 = 111 etc) //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Ce script transforme une prim boîte standard en un panneau plats à 5 faces ; il utilise la fonction llSetPrimitiveParams avec des paramètres spécifiques. // Voici les étapes successives pour obtenir ce résultat : //1.- PRIM_TYPE, PRIM_TYPE_PRISM, 0, <0.2, 0.8, 0.0>, 0.65, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0> : un prisme avec Path Cut B = 0.2 et E = 0.8 ; Hollow à 65 ; Taper X et Y = 0 ; Size X et Y = 1.0 //2. - PRIM_SIZE, <0.01, ((float)imgWidth / (float)imgHeight) * 6.0, 1.0> : la taille de la prim est forcée à X = 0.01, Y = Z * 6 * (largeur de l'image / hauteur de l'image), Z = hauteur de la ligne d'écrans ; mais tenez compte que Y et/ou Z sont limité à 10 mmètres, si le rapport entre largeur et hauteur est de 1.333333 (cas d'une image en 640x480), la valeur maximum pour Z est de 1.25 //3. - De gauche à droite les numéros de face sont : 3, 7, 4, 6, et 1 ; mais les paramètres de textures pour les faces 3, 4, et 1 doivent être ajustés : (la texture dont l'UUID est 5748decc-f629-461c-9a36-a35a221fe21f est la texture standard blanche) //Face 3 - PRIM_TEXTURE, 3, "5748decc-f629-461c-9a36-a35a221fe21f", <2.5, 1.0, 0.0>, <-0.25, 0.0, 0.0>, 0.0 => Hor repeat = 2.5 ; vert repeat = 1.0 ; hor offset = -0.250 //Face 4 - PRIM_TEXTURE, 4, "5748decc-f629-461c-9a36-a35a221fe21f", <-15.4, 1.0, 0.0>, <-0.2, 0.0, 0.0>, 0.0 => Hor repeat = 15.4 flipped ; vert repeat = 1.0 ; hor offset = -0.200 //Face 1 - PRIM_TEXTURE, 1, "5748decc-f629-461c-9a36-a35a221fe21f1", <2.5, 1.0, 0.0>, <0.25, 0.0, 0.0>, 0.0 => Hor repeat = 2.5 ; vert repeat = 1.0 ; hor offset = 0.250 // Coloriage des faces; à remettre en blanc lors de l'utilisation normale //PRIM_COLOR, 5, <1.0, 0.0, 1.0>, 1.0 => les couleurs RGB sont choisies en fonction du muméro de face (5 = 101, 7 = 111 etc) //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Global data //The width of the pictures displayed on a face (in pixels for example) //La largeur des images affichées sur une face (en pixels par exemple) integer imgWidth = 640; //The height of the pictures displayed on a face (in pixels for example) //La hauteur des images affichées sur une face (en pixels par exemple) integer imgHeight = 480; //The height of line of faces //La hauteur de la ligne de faces float fscreenHeight = 1.0; default { state_entry() { llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_PRISM, 0, <0.2, 0.8, 0.0>, 0.65, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, PRIM_SIZE, <0.01, (((float)imgWidth / (float)imgHeight) * 6.0 * fscreenHeight), fscreenHeight>]); llSetPrimitiveParams([PRIM_TEXTURE, 3, "5748decc-f629-461c-9a36-a35a221fe21f", <2.5, 1.0, 0.0>, <-0.25, 0.0, 0.0>, 0.0, PRIM_TEXTURE, 7, "5748decc-f629-461c-9a36-a35a221fe21f", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0, PRIM_TEXTURE, 4, "5748decc-f629-461c-9a36-a35a221fe21f", <-15.4, 1.0, 0.0>, <-0.2, 0.0, 0.0>, 0.0, PRIM_TEXTURE, 6, "5748decc-f629-461c-9a36-a35a221fe21f", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0, PRIM_TEXTURE, 1, "5748decc-f629-461c-9a36-a35a221fe21f", <2.5, 1.0, 0.0>, <0.25, 0.0, 0.0>, 0.0]); llSetPrimitiveParams([PRIM_COLOR, 0, <0.0, 0.0, 0.0>, 1.0, PRIM_COLOR, 1, <0.0, 0.0, 1.0>, 1.0, PRIM_COLOR, 2, <0.0, 1.0, 0.0>, 1.0, PRIM_COLOR, 3, <0.0, 1.0, 1.0>, 1.0, PRIM_COLOR, 4, <1.0, 0.0, 0.0>, 1.0, PRIM_COLOR, 5, <1.0, 0.0, 1.0>, 1.0, PRIM_COLOR, 6, <1.0, 1.0, 0.0>, 1.0, PRIM_COLOR, 7, <1.0, 1.0, 1.0>, 1.0]); } }
|