position of avatar & pics 
Author Message
 position of avatar & pics

Hi all,

Can you tell me how I can change a pic with other one (some .png with alpha
color) based on the position of the avatar?
Sorry for my bad english (I'm Italian) and my poor preparation in vrml :-p

--
A.: "Tu hai molte domande sebbene il tuo processo abbia alterato la tua
coscienza, resti irreversibilmente umano, ergo alcune delle mie risposte
potrai comprenderle, altre no. Concordemente, malgrado la tua prima domanda
possa essere la pi pertinente, potresti renderti conto o non renderti conto
che essa anche la pi irrilevante."

Personal ficm code: Hx19B



Tue, 22 Nov 2005 16:13:23 GMT  
 position of avatar & pics
[cut]

anyone can help me? :(
I tried some possibilities, but nothing good...

--
A.: "Tu hai molte domande sebbene il tuo processo abbia alterato la tua
coscienza, resti irreversibilmente umano, ergo alcune delle mie
risposte potrai comprenderle, altre no. Concordemente, malgrado la tua
prima domanda possa essere la pi pertinente, potresti renderti conto o
non renderti conto che essa anche la pi irrilevante."

Personal ficm code: Hx19B



Fri, 25 Nov 2005 18:40:35 GMT  
 position of avatar & pics

Quote:
>Can you tell me how I can change a pic with other one (some .png with alpha
>color) based on the position of the avatar?

Sorry but i didn't really understand, what do you want to change:
- put a different image according to where you are
- change the position of the image according to where you are
- else ?


Fri, 25 Nov 2005 21:27:00 GMT  
 position of avatar & pics

Quote:

> - put a different image according to where you are

I want to do this :) (sorry for my bad english)

--
A.: "Tu hai molte domande sebbene il tuo processo abbia alterato la tua
coscienza, resti irreversibilmente umano, ergo alcune delle mie
risposte potrai comprenderle, altre no. Concordemente, malgrado la tua
prima domanda possa essere la pi pertinente, potresti renderti conto o
non renderti conto che essa anche la pi irrilevante."

Personal ficm code: Hx19B



Fri, 25 Nov 2005 21:45:34 GMT  
 position of avatar & pics

Quote:
>> - put a different image according to where you are
> I want to do this :) (sorry for my bad english)

Ok, so here are two ways:
- first way is by monitoring when the user enters and leaves an area
(defined a ProximitySensor)
- second way is by deciding according to the coordinates in the world
(the coordinates are retrieved from a ProximitySensor)

------------------------
#VRML V2.0 utf8

DirectionalLight{direction -1 -1 -1}
NavigationInfo{type "WALK"  headlight FALSE}
Viewpoint{position 0 0 10}

####################
#
# Methode 1: When the user is inside the area of 'proxy1'
# the first image is used on the upper cube, otherwise
# it's the second image
#
Transform {
        translation 0 1 0
        rotation 1 0.2 0.3 1
        children Shape{
                appearance DEF app1 Appearance{
                        material Material{diffuseColor 1 1 1  emissiveColor 0.2 0.2 0.2}
                        texture DEF imgA ImageTexture{url "face1.jpg"}
                }
                geometry Box{size 1.5 1.5 1.5}
        }

Quote:
}

DEF proxy1 ProximitySensor{size 15 15 15}
DEF method1 Script{
        field           SFNode          app1                    USE app1
        field           MFNode          textures                [
                USE imgA
                ImageTexture{url "face2.jpg"}
        ]
        eventIn         SFTime          entered_proxy1
        eventIn         SFTime          exited_proxy1
        directOutput TRUE
        url "javascript:
        function entered_proxy1(v,t){app1.texture = textures[1];}
        function exited_proxy1(v,t){app1.texture = textures[0];}
        "
Quote:
}

ROUTE proxy1.enterTime TO method1.entered_proxy1
ROUTE proxy1.exitTime TO method1.exited_proxy1
####################

####################
#
# Method 2: When the user is on the right (so X is above 0)
# the second image is displayed on the lower cube, otherwise
# if the user is on the left, the first image is used
#
Transform {
        translation 0 -1 0
        rotation 1 0.2 0.3 1
        children Shape{
                appearance DEF app2 Appearance{
                        material Material{diffuseColor 1 1 1  emissiveColor 0.2 0.2 0.2}
                        texture DEF imgB ImageTexture{url "face1.jpg"}
                }
                geometry Box{size 1.5 1.5 1.5}
        }

Quote:
}

DEF proxy2 ProximitySensor{size 1000 1000 1000}
DEF method2 Script{
        field           SFNode          app2                    USE app2
        field           MFNode          textures                [
                USE imgB
                ImageTexture{url "face2.jpg"}
        ]
        eventIn         SFVec3f         avatar_position_changed
        directOutput TRUE
        url "javascript:
        function avatar_position_changed(v){
                if (v[0] > 0) {
                        app2.texture = textures[1];
                } else {
                        app2.texture = textures[0];
                }
        }
        "
Quote:
}

ROUTE proxy2.position_changed TO method2.avatar_position_changed
####################


Sat, 26 Nov 2005 03:16:08 GMT  
 position of avatar & pics
[IperCut]

Oh! Your great!!!
It's exactly what i need :)
Thank's very very much :)

Bye
Kjow

--
A.: "Tu hai molte domande sebbene il tuo processo abbia alterato la tua
coscienza, resti irreversibilmente umano, ergo alcune delle mie
risposte potrai comprenderle, altre no. Concordemente, malgrado la tua
prima domanda possa essere la pi pertinente, potresti renderti conto o
non renderti conto che essa anche la pi irrilevante."

Personal ficm code: Hx19B



Sat, 26 Nov 2005 06:22:02 GMT  
 position of avatar & pics
[cut]

Umm... I'm in difficult to add "n" pics... (I used the 2nd method because it
can be easly modified to "Orientation_changed")

Thank you again

--
A.: "Tu hai molte domande sebbene il tuo processo abbia alterato la tua
coscienza, resti irreversibilmente umano, ergo alcune delle mie
risposte potrai comprenderle, altre no. Concordemente, malgrado la tua
prima domanda possa essere la pi pertinente, potresti renderti conto o
non renderti conto che essa anche la pi irrilevante."

Personal ficm code: Hx19B



Sat, 26 Nov 2005 06:43:20 GMT  
 position of avatar & pics
[cut]

ok... Maybe I found the way:

#########################
 field MFNode textures [
  USE imgB ImageTexture{url "2.jpg"}
  USE imgB ImageTexture{url "3.jpg"}
  USE imgB ImageTexture{url "4.jpg"}
 ]
#########################

where the pics are:

textures[0] //default
textures[1] //2.jpg
textures[2] //3.jpg
textures[3] //4.jpg

Now I must "only" found the way to precise the pics in the right "area" :)

Thank's a lot for great help :-p

--
A.: "Tu hai molte domande sebbene il tuo processo abbia alterato la tua
coscienza, resti irreversibilmente umano, ergo alcune delle mie
risposte potrai comprenderle, altre no. Concordemente, malgrado la tua
prima domanda possa essere la pi pertinente, potresti renderti conto o
non renderti conto che essa anche la pi irrilevante."

Personal ficm code: Hx19B



Sat, 26 Nov 2005 07:16:02 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Avatar position to EAI!

2. Getting the position and orientation of the avatar

3. avatar position

4. How to update the position of avatar

5. AVATARS 98- SPECIAL STARSHIP AVATAR CHATS-FREE

6. Avatar Bazaar - Custom Avatars

7. Avatar Studio 2 Avatars Conversion

8. Blaxxun & new avatar

 

 
Powered by phpBB® Forum Software