A propos d'Avatars - About Avatars

 
Post new topic   Reply to topic    VRMLWorld.net Forum Index -> Avatars
View previous topic :: View next topic  
Author Message
Meribastet
Forum Junkie


Joined: 12 May 2009
Posts: 15

PostPosted: Mon May 18, 2009 11:36 am    Post subject: A propos d'Avatars - About Avatars

L’avatar est une part importante de la spécificité de la 3d, il serait donc dommage de se contenter d’arborer une apparence par défaut.
Je me propose de vous indiquer les principales pistes et trucs pour vous personnaliser au mieux.
Dans un premier temps cette présentation est en français mais sera prochainement traduite en anglais. Si des volontaires veulent étendre l’expérience à d’autres langues..

The Avatar is an important part of the specificity of the 3D, it would be a pity to be satisfied with a default appearance.
I’ll try to indicate here the main ways to get a look as you feel.
First I’ll post it in French, but an English version will be soon realized. Of course if somebody is volunteer to translate in other languages ..

See you soon on ABNet

Sommaire :
1 - La base, l’avatar sur ABNet, (use avatar on ABNet)
Ou trouver des avatars (find avatars)
2 - Faire son avatar avec Avatar Studio (make it with Avatar Studio)
3 - Modifier les textures (Modify the textures)
4 - ajouter des objets (Add objects)
5 - ajouter un son (Add sound)
To be continued

[/img][/url]


Last edited by Meribastet on Mon May 25, 2009 9:26 am; edited 1 time in total
Back to top
Meribastet
Forum Junkie


Joined: 12 May 2009
Posts: 15

PostPosted: Mon May 18, 2009 11:51 am    Post subject: AVATARS 1 - La Base

Back to top
Meribastet
Forum Junkie


Joined: 12 May 2009
Posts: 15

PostPosted: Mon May 18, 2009 12:10 pm    Post subject: 2 - Faire son avatar avec Avatar Studio

Pour des avatars humains, le plus simple est de recourir à Avatar Studio. Il se charge gratuitement et facilement et vous permettra de configurer un personnage, en variant sa taille, couleur, vêtements.

A l’origine, il existe deux versions en français qui se complètent + un patch qui permet de les utiliser ensemble :
- créez un dossier « AvatarStudio » et enregistrez les deux versions :


ftp://ftp2.web3d-fr.com/webdfr/avatarStudio/avatarstudio.zip
ftp://ftp2.web3d-fr.com/webdfr/avatarStudio/AvatarStudio20.zip

Téléchargez le patch :
http://kidou.net/fichiers/as/patch30.exe

• exécutez-le.
• en laissant le répertoire par défaut et la case cochée. cliquer sur “Extraire”
• laissez-le finir tranquillement son extraction.
• répondez “Oui” à la question “Désirez-vous lancer ASPatch\ASPatch.exe ?”
• le Patch est maintenant lancé (et sera accessible dans le sous-répertoire ASPatch du répertoire courant)
• suivez les instructions du programme de Patch : Clic sur “Rechercher”, puis “Patcher”
• lancez Avatar Studio 2 … ça devrait marcher

Vous pourrez supprimer le répertoire où il s’est décompressé une fois le patch appliqué ainsi que la version 1 d’AvatarStudio (ce qui fait gagner environs 30 Mo)

Il existe aussi un patch anglais que vous pouvez trouver ici :
http://vrml.alleyweb.co.uk/zap.htm
et qui inclus quelques objets pouvant être joints à l’avatar et de nouvelles textures.
Attention si vous optez pour cette solution tout sera en anglais !

Lorsque vous lancerez Avatar Studio, vous devriez avoir ceci :

Il suffit ensuite de suivre les instructions pour modifier votre personnage :

Dans l’ordre : corps, visage, sous-vêtements, vêtements, accessoires, animation

Pour modifier la couleur ou la texture d’un vêtement, cliquez sur « retoucher » puis sur la pièce à modifier, une liste de textures s’affiche. Il suffit de cliquer sur le motif choisi pour l’appliquer:

Dans le menu « Options » vous avez aussi accès à une aide détaillée et en français.

Lorsque votre personnage est à votre gout, nommez le et sauvegardez en passant par le menu « options » :


Par la suite vous le retrouverez en demandant « Ouvrir »

3 fichiers sont créés dans le répertoire : CANAL Numedia/Avatar Studio/Avatars
Avatar.wrl (le code de l’avatar)
Avatar.jpg (la texture de l’avatar)
Avatar.sav
Les deux premiers devront être copiés sur un espace web pour pouvoir être utilisés dans le monde.
Le dernier reste dans le répertoire avatar studio et est indispensable pour pouvoir le modifier.

N’utilisez pas la « mise en ligne » elle avait été crée à l’époque du 2eMonde de Canal+ ou les avatars pouvaient être chargés directement. Ce site n’existe malheureusement plus.
Back to top
Meribastet
Forum Junkie


Joined: 12 May 2009
Posts: 15

PostPosted: Mon May 18, 2009 12:45 pm    Post subject: 3 - Dessins et textures

Vous voilà en mesure de ressembler à un être humain, vous souhaiterez peut être aller plus loin pour faire preuve de plus d’originalité.
Tout d’abord, pour ne pas vous limiter aux textures proposées, même si elles sont assez variées, deux solutions s’offrent à vous :

1 – AJOUTER DES TEXTURES DANS LE FICHIER :

1 - Fabriquer une texture sympa avec un logiciel de dessin (pour moi photoshop) au format 256 x 256
2- Enregistrer en pcx
3 Créer une deuxième version au format 32 x 32 et toujours pcx
4 – DANS AVATAR STUDIO
Je suppose que comme moi tu as le 1 et le 2 + le patch, donc on trouve :
 Dossiers : looks : les textures de AS1
t- classic
t-cuirs
t- funky
t-trames
 Dossier : patch les textures de AS2
Motifs, peaux et tissus

Dans chaque catégorie :
un fichier pcx par texture ,
exemple :motif-00pcx


un fichier qui reprend l’ensemble tel qu’on le voit avec « modifier » : motif.pcx


un fichier bnk à ouvrir avec bloc notes qui reprend tout ça

 copie du fichier pcx en 256 x 256 dans le dossier de ton choix
 ouvrir dans un logiciel de dessin le fichier qui reprend toutes les textures et y coller dans la première case libre la texture en 32x32
 dans le fichier bnk :

List,motif.PCX
NbPatch,22
Ce nombre est le total des textures enregistrées : en ajouter une
Puis
20,motif-18.pcx
21,motif-19.pcx
22,motif-20.pcx
à la fin de la liste des textures existantes ajouter le nom de la tienne :
23,xxx.pcx

On peut aussi sur le même principe modifier une texture existante ou la remplacer en gardant le même nom ce qui évite la dernière opération dans le bnk ..
Voilà c’est long à expliquer mais facile à faire !

2 – MODIFIER le fichier .jpg avec un logiciel de dessin

Pour cela, copiez les fichiers .wrl et .jpg dans un répertoire que vous créerez à la racine de votre disque C:/ Cela est nécessaire pour pouvoir visionner ensuite le .wrl. En effet il ne s’ouvrira pas si le chemin comporte des espaces.

Ouvrez le fichier de texture dans un logiciel de dessin.
Vous voyez les différentes parties de l’avatar et vous pouvez intervenir à votre gré en modifiant les couleurs et motifs, en ajoutant un dessin sur le corps ou les vêtements.

Attention aux distorsions provoquées par la forme 3d plusieurs essais seront sans doute nécessaires pour obtenir le résultat souhaité. Conservez donc toujours une sauvegarde de l’original.

Dans cet exemple on a ajouté une ceinture, un cœur sur la poitrine et une étoile sur le corsage :


Lorsque le résultat vous convient, enregistrez le sous le nom d’origine pour qu’il soit utilisé comme texture par le wrl.

Attention, même si vous copiez ce fichier dans le répertoire d’Avatar studio vos modifications n’apparaitront pas dans la fenêtre de création.


Last edited by Meribastet on Tue May 19, 2009 8:56 am; edited 2 times in total
Back to top
Meribastet
Forum Junkie


Joined: 12 May 2009
Posts: 15

PostPosted: Mon May 18, 2009 5:41 pm    Post subject: Ajouter un objet

ALLONS VOIR LE CODE

Examiner le code de l’avatar (.wrl) est indispensable pour aller plus loin, ajouter des objets par exemple.
Si vous ouvrez directement le fichier .wrl dans le bloc notes il est illisible. Il faudra avant tout le décompresser.
Pour cela, chargez si vous ne l’avez pas encore WIN.GZ
Vous pouvez l’obtenir ici :

http://meribastet.free.fr/WIN-GZ.EXE

L’utilisation est très simple :

Choisissez votre fichier (Select File)
Optez pour « Name as Original » puis « Gunzip »
Ouvrez le fichier au bloc note, le voilà en clair.

AJOUTER UN OBJET
Il faudra ajouter au fichier original non seulement le code de l’objet lui-même mais aussi certaines modifications pour qu’il reste « collé » à l’avatar et suive ses mouvements.
Ces codes sont les suivants :

1 – Celui qui contient l’objet :

Code:
#ETAPE1
########################################################
DEF center_Obj Transform{}
DEF vl5_Obj Transform{}
DEF vc7_Obj Transform{}
DEF neck_Obj Transform{}
DEF skull_Obj Transform{# Ceci indique la position de l’objet, dans ce cas la tête
    children [
#Ici se trouvera le code de l’objet à ajouter
]}
DEF r_wrist_Obj Transform{}
DEF l_wrist_Obj Transform{}
 #######################################################


Repérez: } #shape
et coller les codes de l'étape 1 juste après

2 – Les 3 autres blocs, à ne pas modifier :

Code:
# ETAPE 2
#######################################################
 eventOut SFVec3f pos_Center_changed
eventOut SFRotation rot_Center_changed

eventOut SFVec3f pos_vl5_changed   
 eventOut SFRotation rot_vl5_changed

 eventOut SFVec3f pos_vc7_changed
 eventOut SFRotation rot_vc7_changed

 eventOut SFVec3f pos_neck_changed
 eventOut SFRotation rot_neck_changed

 eventOut SFVec3f pos_skull_changed
 eventOut SFRotation rot_skull_changed

 eventOut SFVec3f pos_r_wrist_changed
 eventOut SFRotation rot_r_wrist_changed

 eventOut SFVec3f pos_l_wrist_changed
 eventOut SFRotation rot_l_wrist_changed
#######################################################


Code:
# ETAPE 3
//#####################################################
  m0=new VrmlMatrix();
  m0.setTransform(P[0],R[0]);
  m1=new VrmlMatrix();
  m1.setTransform(P[1],R[1]);m1=m1.multRight(m0);
  m2=new VrmlMatrix();
  m2.setTransform(P[2],R[2]);m2=m2.multRight(m1);
  m3=new VrmlMatrix();
  m3.setTransform(P[3],R[3]);m3=m3.multRight(m2);
  m4=new VrmlMatrix();
  m4.setTransform(P[4],R[4]);m4=m4.multRight(m3);
  m5=new VrmlMatrix();
  m5.setTransform(P[7],R[7]);m5=m5.multRight(m4);
  m6=new VrmlMatrix();
  m6.setTransform(P[8],R[8]);m6=m6.multRight(m5);

m1.getTransform(pos_Center_changed,rot_Center_changed);

 m3.getTransform(pos_vl5_changed,rot_vl5_changed);
  m4.getTransform(pos_vc7_changed,rot_vc7_changed);
  m5.getTransform(pos_neck_changed,rot_neck_changed,scale);
  m6.getTransform(pos_skull_changed,rot_skull_changed,scale);

  m7=new VrmlMatrix();

  m5.setTransform(P[18],R[18]);m5=m5.multRight(m4);
  m6.setTransform(P[19],R[19]);m6=m6.multRight(m5);
  m6.setTransform(P[20],R[20]);m6=m6.multRight(m5);
  m7.setTransform(P[21],R[21]);m7=m7.multRight(m6);
  m7.getTransform(pos_r_wrist_changed,rot_r_wrist_changed);

  m5.setTransform(P[23],R[23]);m5=m5.multRight(m4);
  m6.setTransform(P[24],R[24]);m6=m6.multRight(m5);
  m6.setTransform(P[25],R[25]);m6=m6.multRight(m5);
  m7.setTransform(P[26],R[26]);m7=m7.multRight(m6);
  m7.getTransform(pos_l_wrist_changed,rot_l_wrist_changed);
//#####################################################


Code:
# ETAPE 4
#######################################################
ROUTE Welder.pos_Center_changed TO center_Obj.set_translation
ROUTE Welder.rot_Center_changed TO center_Obj.set_rotation
ROUTE Welder.pos_vl5_changed TO vl5_Obj.set_translation
ROUTE Welder.rot_vl5_changed TO vl5_Obj.set_rotation
ROUTE Welder.pos_vc7_changed TO vc7_Obj.set_translation
ROUTE Welder.rot_vc7_changed TO vc7_Obj.set_rotation
ROUTE Welder.pos_neck_changed TO neck_Obj.set_translation
ROUTE Welder.rot_neck_changed TO neck_Obj.set_rotation
ROUTE Welder.pos_skull_changed TO skull_Obj.set_translation
ROUTE Welder.rot_skull_changed TO skull_Obj.set_rotation
ROUTE Welder.pos_r_wrist_changed TO r_wrist_Obj.set_translation
ROUTE Welder.rot_r_wrist_changed TO r_wrist_Obj.set_rotation
ROUTE Welder.pos_l_wrist_changed TO l_wrist_Obj.set_translation
ROUTE Welder.rot_l_wrist_changed TO l_wrist_Obj.set_rotation
######################################################


Ils sont à positionner de cette façon :

Etape 2:
Repérez: directOutput TRUE et coller les codes de l'étape 2 juste après
* Pour info, la ligne suivante est: "eventIn SFBool Watched"

Etape 3:
Repérez: eventsProcessed(){
if(mode==2) Vtx.point.setByVertexTransform(V,vgroups,P,R);

et coller les codes de l'étape 2 juste après
*Pour info, les lignes suivantes sont:
}
function Gstart(g,t){


Etape 4:
Repérez: ROUTE Walker.walkFrac TO Welder.fooEvents (à la fin du fichier)
et coller les codes de l'étape 4 juste après
*Pour info, la ligne suivante est: }#PROTO Avatar

Si vous souhaitez faire un essai en utilisant une chevelure bouclée que vous avez du croiser sur certains avatars, vous trouverez ici : http://meribastet.free.fr/HairEtape1.txt
Le code de l’« Etape1 » la contenant
Voilà le résultat :

Vous remarquerez que le code des cheveux est inséré dans :
Code:
DEF skull_Obj Transform{
    children [ ]}
ce qui correspond à la position de la tête

Vous pouvez attacher des objets à d’autres parties du corps, par exemple pour une jupe utiliser la position : center
Code:
DEF center_Obj
Transform{
translation -.013 -.903 .007
children[
Shape{
appearance Appearance  ---]}


Construisez l’objet centré sur 0 dans toutes les dimensions et ajustez ensuite en faisant des essais. Soyez aussi attentif à la dimension dès la création.



Attention toutefois, pensez à l’objet que vous souhaitez ajouter lorsque vous créez votre avatar. Il faut penser en particulier à ce que des parties du corps n’entrent pas en collision avec l’objet en fonction des animations. Une jupe comme celle-ci par exemple est rigide. Ne prévoyez pas de position assise qu’elle ne suivrait pas. Vous pouvez aussi avoir à rectifier la marche afin que les jambes ne traversent pas le vêtement !

Nota : si vous utilisez la version anglaise qui comporte des objets, c'est encore plus simple : Ajoutez un objet quelquonque à votre avatar, les codes se mettent tout seuls !
Il suffit ensuite de supprimer l'objet du programme pour le remplacer par le votre (au bon endroit bien sur !)


Last edited by Meribastet on Tue May 19, 2009 8:57 am; edited 1 time in total
Back to top
Rick
Site Admin


Joined: 08 May 2003
Posts: 106
Location: NC, US

PostPosted: Tue May 19, 2009 8:07 am    Post subject:

Excellent article Meribastet! J'ai lu vos messages en anglais en utilisant Google Translate fonctionnalité. Il semble bien fonctionner.

-rick
Back to top
vcard
Forum Junkie


Joined: 01 Aug 2008
Posts: 58

PostPosted: Sat May 23, 2009 10:21 am    Post subject:

Yes, its a nice introduction to av making and with some advanced topics like adding objects. Very Happy

Soon we will annouce more news on cool avatar use here in ABNet. Some examples:
-Controlling avatar movements in world, like: "you click on a chair and your avatar sits there"
-Make your avatar fly, with a specific gesture. You select fly on the 3d scene and your av looks like flying automatically (not walking as normal av studio avatars do now).

vcard


[/list]
Back to top
Meribastet
Forum Junkie


Joined: 12 May 2009
Posts: 15

PostPosted: Mon May 25, 2009 9:24 am    Post subject: 5 - Ajouter un son

AJOUTER UN SON
Ces sons seront déclenchés par un clic sur l’avatar


1 En format .wav

Il faudra ajouter 3 séries dans le code de l’avatar
La première contiendra le son que vous souhaitez et ses paramètres :
Code:
#------------------------------------------------------
DEF dad_Sound2 Transform {
     translation 0.0 0.0 0.0
     children [
      DEF Sound2 Sound {
       source DEF AClip_Sound2 AudioClip {
#indiquez ici le nom de votre son qui doit être dans le même dossier que les autres fichiers de l’avatar. Si vous utilisez un lien externe indiquez l’adresse complète.
      url "monson.wav"
#Vous pouvez modifier là la vitesse du son (1.000 = defaut)
      pitch  1.000
#Le nombre de fois ou le son est joué, loop TRUE le laisse jouer en boucle
        loop   FALSE
        startTime -1
        stopTime  0
       }
#le volume du son (1.000 = defaut)
       intensity  1.000
       priority   0.000
#la distance à partir de laquelle il se déclenchera
       minBack    10.000
       minFront   10.000
       maxBack    500.000
       maxFront   500.000
      }
     ]
    }
#------------------------------------------------------

Ce code doit se situer après
DEF vis VisibilitySensor { size 1 2 1 center 0 1 0 }
Et avant
Shape {

Les deux codes suivants n’ont pas à être modifiés :

Code:
#------------------------------------------------------
DEF Script_Sound2 Script {
  field    SFNode      snd     USE  AClip_Sound2
field    SFBool      state     FALSE
field    SFTime      pause     0
eventIn  SFTime      startAt0
directOutput         TRUE
url "vrmlscript:
 function startAt0( stime ) {
 state = TRUE;
 snd.set_startTime = stime;
 snd.set_stopTime = 0;
 }
"
}
#------------------------------------------------------

A placer après
} #shape

Code:
ROUTE TOUCH.touchTime TO Script_Sound2.startAt0

A placer après
}#switch
ROUTE vis.isActive TO Welder.Watched
Et avant
ROUTE TOUCH.touchTime TO Welder.Touch

2 - En format .mp3

Pour un mp3 la solution précédente ne suffit pas.
Il faudra accrocher le son à un objet invisible et de dimensions nulles.
La méthode sera alors sensiblement la même que celle qui concerne les objets.
Le code de l’objet sera :


Code:
Shape
  {
   appearance Appearance
   {
    texture DEF Sn2 MovieTexture
    {
     url "monson.mp3"
    }
   }
#--- dimensions : nulles
   geometry Box
   {
    size 0 0 0
   }
  }
#--- le sensor déclencheur
  DEF Sr2 TouchSensor{}

Placé de préférence en « Center »

Copiez ensuite les autres étapes comme pour un objet
Et en plus :

Code:
ROUTE Sr2.touchTime TO Sn2.set_startTime

À la position indiquée ci-dessus, soit entre
ROUTE vis.isActive TO Welder.Watched
Et
ROUTE TOUCH.touchTime TO Welder.Touch
Back to top
Laz
Forum Junkie


Joined: 15 May 2003
Posts: 91
Location: upper midwest

PostPosted: Mon May 25, 2009 10:53 am    Post subject: very nice tutorial

Very nice tutorials Meri. I would just like to add something to this as I have been adding some sounds to avatars lately myself and found a very easy way to accomplish this using the exsisting functions and it also automatically shares sound. to all users

First you want to add the sound nodes to your file. I used 4 Sound nodes in this avatar to coincide with 4 gestures i wanted to use for them.




Quote:

DEF skull_Obj Transform {
children [
Sound {
minFront 0 maxFront 20
minBack 0 maxBack 20
intensity 1
spatialize TRUE
source DEF hello AudioClip{
loop FALSE
pitch 1
url "fem-hello.wav"
}
}
Sound {
minFront 0 maxFront 20
minBack 0 maxBack 20
intensity 1
spatialize TRUE
source DEF bye AudioClip{
loop FALSE
pitch 1
url "fem-bye.wav"
}
}
Sound {
minFront 0 maxFront 20
minBack 0 maxBack 20
intensity 1
spatialize TRUE
source DEF no AudioClip{
loop FALSE
pitch 1
url "fem-no.wav"
}
}
Sound {
minFront 0 maxFront 20
minBack 0 maxBack 20
intensity 1
spatialize TRUE
source DEF sleepy AudioClip{
loop FALSE
pitch 1
url "sleepy.wav"
}
}
]
}


I used .wav files here but .mp3 can be also used inside of sound node as long as the .mp3 is encoded as mono rather than stereo. Not all people are able to hear .mp3 however so the method of putting in a movieTexture node might be best if you want it to always be heard. Only draw back is that this is not spatialized sound and can be heard throughout the world.


Next we have to include a method to play these sounds. not only to we want to play them but we want them to be shared events as well.

Below is a set of functions defined inside the welder script. These functions use the event call from the server and output an SFTime event that starts all timesensors. we use these function to also send startTime event to our sound files so that they are also shared.

Quote:

function G0(t){Gstart(0,t);
function G1(t){Gstart(1,t);
function G2(t){Gstart(2,t);sleepy.startTime = (t);}
function G3(t){Gstart(3,t);}
function G4(t){Gstart(4,t); hello.startTime = (t);}
function G5(t){Gstart(5,t);no.startTime = (t);}
function G6(t){Gstart(6,t);
function G7(t){Gstart(7,t);
function G8(t){Gstart(8,t);
function G9(t){Gstart(9,t);bye.startTime = (t);}
function G10(t){Gstart(10,t);
function G11(t){Gstart(11,t);}


The text in red is all that i added to the code and it not only starts the sound files but makes it a shared event and also it starts the sound files whenever these gestures are used. So in otherwords, if the avatar uses the hello gesture you also get a sound file that says hello at the same time.

In addition to the gesture sounds if you want to assign a special gesture and/or sound to the click function there is already a place in the Welder script for this. It is located just a few lines below the other functions mentioned above and you have only to change one character in the line.


Quote:
function Touch(t){G4(t);}


The G4 represents the gesture you wish to access when the avatar is clicked. You merely change that to the gesture function that you desire.

Embarassed Almost forgot a very important step...
You should declare the fields for the Sound nodes in the Welder script so the script can access them directly. so anywhere in the script header place the SFNode fields.


Quote:

DEF Welder Script {
field SFNode hello USE hello
field SFNode bye USE bye
field SFNode no USE no
field SFNode sleepy USE sleepy
# etc.....


The avatar gesture list in the top of the file is an MFString. those values coincide with the "G" functions and gestures in the welder script.
Quote:
exposedField MFString gestureNames["BonJourlil","Sitlil","Sleepylil","Fly","Hello","No","Dance","Shake","Laugh","Bye","Poselili","Marche lili",]


for example "Hello" is the equivalent of G4 in the script. MF fields always start 0 so G0 is BonJourlil and it counts upward from there.

Ok so when you have changed the function you wish in the Welder script you are done. There is no need to add routes since these functions already have a route associated with them and anything you put inside that function will have a startTime Event or some other event sent to it when it is accessed.

There are many ways to do things sometimes and This is just one of them. I just thought I would share this since it is a very simple way and it ends up being shared by default.

Below is the example file.


http://home.comcast.net/~lazerousvr/avs/women/luci3.wrl
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VRMLWorld.net Forum Index -> Avatars All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum