About Avatars - all in english

 
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 Jun 01, 2009 4:27 pm    Post subject: About Avatars - all in english

Back to top
Meribastet
Forum Junkie


Joined: 12 May 2009
Posts: 15

PostPosted: Mon Jun 01, 2009 4:31 pm    Post subject: Avatars 2 - Build a character

For human avatars, the simplest is to use Avatar Studio. It is free and easily downloaded and allows you to configure a character, choosing size, color, clothing.

Initially there are two complementary versions in French + a patch that allows you to use them together:
- Create a folder "AvatarStudio" and save the two versions:
ftp://ftp2.web3d-fr.com/webdfr/avatarStudio/avatarstudio.zip
ftp://ftp2.web3d-fr.com/webdfr/avatarStudio/AvatarStudio20.zip

- Download the patch :
http://kidou.net/fichiers/as/patch30.exe

? Run it
? Leave the default folder and the checked. Click on ?Extraire? (extract)
? Let it make the job.
? Answer ?Oui? when asked ?D?sirez-vous lancer ASPatch\ASPatch.exe ?? (you accept to run it)
? The Patch is now installed (and will be accessqible in the subfolder ASPatchin the current directory)
? Follow the instructions in the program : Click on ?Rechercher?, then ?Patcher?
? launch Avatar Studio 2 ? it should work

After that you can delete the directory where the patch is decompressed and the version 1 of Avatar Studio in order to save some space.
There is also an english patch here :
http://vrml.alleyweb.co.uk/zap.htm
it included some items that can be attached to the avatars, and new textures.
If you install it all will be in english !

When you launch Avatar Studio, you should get this :
[/url]
Choose a preset avatar and clic the cross to enter your choice.
You access the page where you can adjust it
Then use these icons to modify your character :

In order : body, face, underwear, clothings, accessories, animation
Click on a exsisting clothing to undress
Click on a new clothing to wear it

To change the color or texture of a garnment, click on ? retoucher ? then on the name of the clothing a choice appears, you have just to click on a pattern to apply it



In the ? Options ? menu you access to a complete help in French (Aide).
In the English version you have it in English.

When you character suits you, give it a name and save it with the ?Options? menu ? ?Sauver?

After that, you will find it by asking ? Ouvrir ?
4 files are created in the directory : CANAL Numedia/Avatar Studio/Avatars
Avatar.wrl (code of the avatar)
Avatar.jpg (texture of the avatar)
Avatar.sav
avatar.grd (in english versionh only)
The first two must be copied on a web space to be used in a world
The last 2 remains in the file directory and is needed to make any change.
Dont use ? mise en ligne ? it was created for the ? 2eMonde ? where avatars could be directly loaded. This site is unfortunately over.

Some vocabulary to use the french verson :
Retour : back
Nouveau : new
Ouvrir : Open
Sauver : save
Aide : help
Muet : mute
Quitte : quit
Retoucher : change
Choisir : choose
Jambes : legs
Fesses : buttock
Bras : arms
Seins : chest
Mensurations : measurements
Lumi?re : light
Ombre : shade
Peau : skin
Cils : lashes
Levres : lips
Sourcils : eyebrows
Nez : nose
Coiffure : hair
Yeux : eyes
Bouche : mouth
Tete : head
Machoire : jaw
Menton : chin
Oreilles : ears
Joues : cheeks
Pommettes : knobs
Back to top
Meribastet
Forum Junkie


Joined: 12 May 2009
Posts: 15

PostPosted: Mon Jun 01, 2009 5:42 pm    Post subject: Avatars 3 - change textures

GOING FURTHER
Now, you're able to look like a human being, you may wish to go further for more originality.
First, not to limit yourself to the proposed textures, although they are quite varied, two possibilities:

1 ?ADD TEXTURES IN THE FILE :

1 - Make a nice texture with a drawing software (for me photoshop) format 256 x 256
2 - Save as .pcx
3 - Create a second version in the format 32 x 32 and still .pcx
4 ? IN AVATAR STUDIO
I suppose like me you have 1 and 2 + the patch, so we found:
Files: looks: the textures AS1
t-classic
t-cuirs
t-funky
t-trames
File: patch : textures AS2
patterns, skins fabrics (Motifs, peaux et tissus)

In each category:
A .pcx files for each texture,

Example :

motif-00pcx
A file that contains all that we see with ? Modifier ? (modify) :


motif.pcx

A BNK file to open with a text editor who contains all that

- copy the 256 x 256 .pcx file in the folder of your choice
- open into a drawing software the file that contains all the textures and paste in the first free space the 32x32 texture

- in the BNK:

List,motif.PCX
NbPatch,22

This is the total of the existing textures. Add one
Then
20,motif-18.pcx
21,motif-19.pcx
22,motif-20.pcx

At the end of the list of existing textures, add yours :
23,xxx.pcx

You can also on the same principle modify an existing texture or replace it with the same name thus avoiding the last operation in BNK ..
That is harder to explain but easy to do!

2 ? EDIT .jpg file with a drawing software

To do this, copy the files . wrl and .jpg in a directory at the root of your drive C: / This is necessary to watch then . wrl. Indeed it will not open if the path contains spaces.

Open the .jpg in a drawing software.
You see the different parts of the avatar and you can change the colors and patterns, add a drawing on the body or clothing.
Be carefull to the distortions caused by the 3D shape more tests may be needed to obtain the desired result. Always keep a backup of the original.

In this example we added a belt, a heart on the chest and a star on the bodice:



When the result suits you save it under the original name to be used as texture by wrl.

Attention ! even if you copy this file in the directory Avatar Studio your changes will not appear in the creation window.
Back to top
Meribastet
Forum Junkie


Joined: 12 May 2009
Posts: 15

PostPosted: Wed Jun 03, 2009 4:03 pm    Post subject: Avatars 4 - Add an object

LET US SEE THE CODE

Examine the code of the avatar (. Wrl) is required to go further, add objects, for example.
If you open the file directly it is unreadable. It will primarily unzipped.
To do this, load, if you have not yet WIN.GZ
You can get it here:
[url] http://meribastet.free.fr/WIN-GZ.EXE[/url]
It is very easy to use :


Select your File
Choose ? Name as Original ? then ? Gunzip ?
Open the file in notepad.


ADD AN OBJECT

It is necessary to add to the original file not only the object code itself, but also some changes to enable it to remain "stuck" in the avatar and follow its movements.

These codes are:

1 ?One containing the object :

Code:
#STEP1
########################################################
DEF center_Obj Transform{}
DEF vl5_Obj Transform{}
 DEF vc7_Obj Transform{}
 DEF neck_Obj Transform{}
 DEF skull_Obj Transform{# This indicate the position, in this case the head
    children [
#Here you paste you own code
]}
 DEF r_wrist_Obj Transform{}
 DEF l_wrist_Obj Transform{}
 #######################################################

Locate : } #shape
Paste the code of ?STEP1? after

2 ?3 other blocks, not to change :

Code:
#STEP 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:
# STEP3
//#####################################################
  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:
#STEP 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
######################################################


They must be positionned this way :

STEP2:
Locate : directOutput TRUE
Paste the STEP2 here
*The next line is : "eventIn SFBool Watched"

STEP3:
Locate : eventsProcessed(){
if(mode==2) Vtx.point.setByVertexTransform(V,vgroups,P,R);
Paste the STEP3 here
*The next lines are :
}
function Gstart(g,t){


STEP4:
Locate : ROUTE Walker.walkFrac TO Welder.fooEvents (? la fin du fichier)
Paste the STPE4 here
*The next line is : }#PROTO Avatar

If you want to try using a curled hair frequently used, you will find here http://meribastet.free.fr/HairEtape1.txt
The code of ?STEP1? including it
Look at the result :



You will notice that the code of the hair is inserted in :
Code:
DEF skull_Obj Transform{
    children [ ]}

which is the head position

You can attach objects to other parts of the body, for example for a skirt use center :

Code:
DEF center_Obj
Transform{
translation -.013 -.903 .007
children[
Shape{
appearance Appearance ...]}


Build the object centered at 0 in all dimensions and then adjust by testing. Be carefull to the scale during your creation.



Caution, however, think of the object you want to add when you create your avatar. You must avoid particularly that body parts collide with it during the gestures. A skirt like this for example, is rigid. It cant follow a sitting gesture. You may also have to rectify the walk so that the legs do not pass through the garment !

Note: if you use the English version, which includes objects, it's even simpler: Add any item to your avatar, the codes will take place alone!
Then remove the object and replace it with yours (in the right place of course!)
Back to top
Meribastet
Forum Junkie


Joined: 12 May 2009
Posts: 15

PostPosted: Wed Jun 03, 2009 4:14 pm    Post subject: Avatars 5 - Add a sound

ADD A SOUND

These sounds will be triggered by a click on the avatar.

1 - Using .wav format

It will be necessary to add 3 nodes in the code of the avatar
The first one will contain the sound which you wish to use and its parameters:
Code1:


Code:
#------------------------------------------------------
DEF dad_Sound2 Transform {
     translation 0.0 0.0 0.0
     children [
      DEF Sound2 Sound {
       source DEF AClip_Sound2 AudioClip {
#point out the name here of your sound which must be in the same file as the other files of the avatar. If you use an external link point out complete address.
      url "mysound.wav"
# You can change the speed of sound there (1.000 = default)
      pitch  1.000
# The number of times the sound is played, loop TRUE lets it play in a continuous loop
        loop   FALSE
        startTime -1
        stopTime  0
       }
# the volume of sound (1.000 = default)
       intensity  1.000
       priority   0.000
# the distance from which it will start
       minBack    10.000
       minFront   10.000
       maxBack    500.000
       maxFront   500.000
      }
     ]
    }
#------------------------------------------------------

This code must follow:
DEF screw VisibilitySensor {size 1 2 1 center 0 1 0}
And front
Shape {

Both following codes do not have to be changed:

Code 2:

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;
 }
"
}
#------------------------------------------------------

place afterwards
} #shape

Code 3 :

Code:
ROUTE TOUCH.touchTime TO Script_Sound2.startAt0

place afterwards :
}#switch
ROUTE vis.isActive TO Welder.Watched
And front
ROUTE TOUCH.touchTime TO Welder.Touch

2 - Using .mp3 format

For using an mp3 the previous solution is not enough.
It will be necessary to place the sound on an invisible object.
Method will be the same as for objects.
The code of the object will be:

Code:
Shape
  {  appearance Appearance
   {  texture DEF Sn2 MovieTexture
    { url "mysound.mp3"
    }
   }
#--- dimensions : null
   geometry Box
   {  size 0 0 0
   }
  }
#--- the sensor for activation
  DEF Sr2 TouchSensor{}


Put it preferably on ? Center ?

Copy other steps as for an object
And add ROUTE:
Code:
 ROUTE Sr2.touchTime TO Sn2.set_startTime

In the position pointed out above,
Between :
ROUTE vis.isActive TO Welder.Watched
And :
ROUTE TOUCH.touchTime TO Welder.Touch
Back to top
Meribastet
Forum Junkie


Joined: 12 May 2009
Posts: 15

PostPosted: Wed Jun 03, 2009 4:38 pm    Post subject: Avatars 6 - Sounds and gestures

What follows was added by Laz and allows to associate sounds to gestures, so your avatar can for example wawe hello AND say "Hello" !
It let Laz explain it :


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);}
Quote:


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.

function Touch(t){G4(t);}[quote]
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.

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
Laz
Forum Junkie


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

PostPosted: Sun Jun 07, 2009 4:53 pm    Post subject: Very Nice!

Very nice tutorial Meri. I can tell you that I understand every bit of it and your translation is very good. I am sure that people will find this information very helpful in avatar creation. Thank you very much for doing this and YOU ROCK! Very Happy
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