LouiZeForum

3D vrml
 
HomeHome  FAQFAQ  SearchSearch  RegisterRegister  MemberlistMemberlist  UsergroupsUsergroups  Log in  3Dchats / forums3Dchats / forums  

Share | 
 

 Exemples

View previous topic View next topic Go down 
AuthorMessage
alain
fondateur
fondateur
avatar

Number of posts : 23084
Localisation : Dompierre sur Veyle ,France
Registration date : 2005-04-19

PostSubject: Exemples   Tue 29 Nov - 4:17

UN :

Quote :

Ecrit le: dimanche 27 novembre 2005, 15:08
par lionel
pour un objet particulier, j'ai besoin de compter le nombre de clic afin de désactiver le touchsensor au bout d'un certains nombres de clics.
J'ai donc fait çà:

tir = TRUE;
nombreclic = nombreclic - 1;
if (nombreclic = 0)
tir = FALSE;

mais çà ne fonctionne pas.
nombredeclic est un SFFloat, tir est un SFBool.

Quelqu'un a-t-il une idée de la façon de procéder ?
.................

Jean-Michel Ecrit le: dimanche 27 novembre 2005, 21:09
if (nombreclic == 0)

et pas if (nombreclic = 0) non ?

.......................................................................
Deux :

Quote :

je voudrais savoir comment connaitre les coordonnées spatials de mon avatar ds un monde 3d

Quote :
Arsène Ecrit le: lundi 28 novembre 2005, 18:53


Le code VRML :
CODE
#VRML V2.0 utf8

Viewpoint {
}

DEF prox ProximitySensor {
size 1000 1000 1000 # 1 km cube
}

DEF cadence TimeSensor {
cycleInterval 10 # toutes les 10 secondes
loop TRUE
}

DEF script Script {
eventIn SFTime cycleTime
eventIn SFVec3f position
eventIn SFRotation orientation
field SFNode node Script {eventIn MFNode event} # script bidon
field SFString baseURL "http://domain.tld/path/file.php?px="
url "javascript:
function cycleTime() {
var phpURL = baseURL + position.x + '&py=' + position.y + '&pz=' + position.z +
'&ox=' + orientation.x + '&oy=' + orientation.y + '&oz' + orientation.z +
'&oa=' + orientation.angle;
// Browser.print(phpURL);
Browser.createVrmlFromURL(phpURL, node, 'event');
}
"
}

ROUTE prox.position_changed TO script.position
ROUTE prox.orientation_changed TO script.orientation
ROUTE cadence.cycleTime TO script.cycleTime



_________________
http://mixed3d.net/
Back to top Go down
View user profile
fabricator
+200
+200
avatar

Number of posts : 227
Localisation : Australia
Registration date : 2005-08-28

PostSubject: Re: Exemples   Wed 14 Dec - 18:37

alain wrote:
UN :

Quote :
Arsène Ecrit le: lundi 28 novembre 2005, 18:53


Le code VRML :
CODE
#VRML V2.0 utf8

Viewpoint {
}

DEF prox ProximitySensor {
size 1000 1000 1000 # 1 km cube
}

DEF cadence TimeSensor {
cycleInterval 10 # toutes les 10 secondes
loop TRUE
}

DEF script Script {
eventIn SFTime cycleTime
eventIn SFVec3f position
eventIn SFRotation orientation
field SFNode node Script {eventIn MFNode event} # script bidon
field SFString baseURL "http://domain.tld/path/file.php?px="
url "javascript:
function cycleTime() {
var phpURL = baseURL + position.x + '&py=' + position.y + '&pz=' + position.z +
'&ox=' + orientation.x + '&oy=' + orientation.y + '&oz' + orientation.z +
'&oa=' + orientation.angle;
// Browser.print(phpURL);
Browser.createVrmlFromURL(phpURL, node, 'event');
}
"
}

ROUTE prox.position_changed TO script.position
ROUTE prox.orientation_changed TO script.orientation
ROUTE cadence.cycleTime TO script.cycleTime



field SFString baseURL "http://domain.tld/path/file.php?px="
var phpURL = baseURL + position.x + '&py=' + position.y + '&pz=' + position.z +
'&ox=' + orientation.x + '&oy=' + orientation.y + '&oz' + orientation.z +
'&oa=' + orientation.angle;

This could also be re-written as:

field SFString baseURL "http://domain.tld/path/file.php?"
var phpURL = baseURL + 'p=' + position.x + '_' + position.y + '_' + position.z +
'&o=' + orientation.x + '_' + orientation.y + '_' + orientation.z + '_' + orientation.angle;


Then you simply have the php script replace the _ characters with spaces or commas. It not only makes the script simplier but it also reduces the URL length, as remember its 256 characters in most cases.
Back to top Go down
View user profile http://www.vrmlworlds.com
alain
fondateur
fondateur
avatar

Number of posts : 23084
Localisation : Dompierre sur Veyle ,France
Registration date : 2005-04-19

PostSubject: Re: Exemples   Wed 14 Dec - 20:47

Aahahah it is funny , and nice to see you here , fab, you surprised me , I must say Smile

May be you have a bit more time with the crazy blaxxun thing down , but I saw too , from rogue , that you were in the shared event things with Pyth ..

Well thanks to be here , let me say that , plz : you remember , I guess , that I am just a poor art teacher , lol , using vrml for "fun" , and also at school with pupils ......

I tried and I try , from time to time to look at some scripts , to see how it is done , how I could change some parts etc etc ...
One , day it was very strange and great hasard , you found me playing with your slimes , lol ...

Well , ....that summer I tried to work a bit with my greater son , Asheanor , we were on holidays and we decided to spend 1 hour each day for some scripting lessons , together .....Reason why I opened that part on Louise ...
But after one week he was tired and prefered the pool , lol ......

Now he is in an upper school , he just begin to learn My sql ,C++ , etc etc , and he is very happy with php ..
For me all that is too difficult for my small brain and I have not many time for ..
Some times I find some scipts , ( here up it was from some guys on web3d-fr.com ) and I copy some , hoping to find a bit time to study them ..
Not sure if that will happen ......
I become older , it is a pity , I hate that , lol , but I realised that I will be able to get some works from my son now ahahahah !
He is both working with 3DSmax and now with EasyPhp , so I hope I will ba able to set up some team , lol ...

Thanx for your post , I will kook at it , because , bytheway , I like to learn and to try to understand things I am unable to understand , lol .....

Long life to blaxx !!! Smile vive l'Australie Smile

( arggggggg this post is too long , scuse ! )

_________________
http://mixed3d.net/
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: Exemples   

Back to top Go down
 
Exemples
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Infos section: tutoriels et exemples
» Banque d'exemples C++
» [Ressources] Banque d'exemples Game Maker
» Le positionnement géographique
» Première construction diapo

Permissions in this forum:You cannot reply to topics in this forum
LouiZeForum :: ARTS :: 3D art :: Script-
Jump to: