Vrml et php
Fermé
quark22
Messages postés
25
Date d'inscription
mercredi 29 août 2007
Statut
Membre
Dernière intervention
8 janvier 2009
-
12 déc. 2007 à 16:11
magnus - 12 mars 2008 à 19:42
magnus - 12 mars 2008 à 19:42
Bonjour,
J'ai fait un script en PHP pour afficher du VRML et j'aimerai que ce script principal appelle un script secondaire qui récupére l'heure du serveur, puis je mets l'heure dans une variable et comment récupérer cette variable dans mon script principal en VRML
merci
J'ai fait un script en PHP pour afficher du VRML et j'aimerai que ce script principal appelle un script secondaire qui récupére l'heure du serveur, puis je mets l'heure dans une variable et comment récupérer cette variable dans mon script principal en VRML
merci
A voir également:
- Vrml et php
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Retour à la ligne php ✓ - Forum PHP
- Php?id=1 - Forum PHP
- Php natif - Forum PHP
1 réponse
Le plus simple est d'afficher celui du client quand il regarde le vrml à default de posséder son propre serveur :
<?php
if (!$test) { header ("Content-type: model/vrml"); }
?>
#VRML V2.0 utf8 Copyright © 2007, magnus
DEF Appearance Appearance { material Material { diffuseColor 1 0 0 emissiveColor 1 0 0 } }
DEF FontStyle FontStyle { justify "MIDDLE" style"BOLD" }
Transform { translation -2 0 0 children [ Shape { geometry DEF str_heure Text { string "00" fontStyle USE FontStyle } appearance USE Appearance } ] }
Transform { translation -1 0 0 children [ DEF point Shape { geometry Text { string ":" fontStyle USE FontStyle } appearance USE Appearance } ] }
Transform { translation 0 0 0 children [ Shape { geometry DEF str_minute Text { string "00" fontStyle USE FontStyle } appearance USE Appearance } ] }
Transform { translation 1 0 0 children [ USE point ] }
Transform { translation 2 0 0 children [ Shape { geometry DEF str_seconde Text { string "00" fontStyle USE FontStyle } appearance USE Appearance } ] }
Transform { translation 0 1 0 children [ Shape { geometry DEF str_date Text { string "jour date mois année" fontStyle USE FontStyle } appearance USE Appearance } ] }
DEF TimeSensor TimeSensor { loop TRUE }
DEF Script Script {
eventIn SFTime set_startTime
field SFInt32 hrs 0 field SFInt32 min 0 field SFInt32 sec 0
field SFInt32 day 0
field SFInt32 nbr 0
field SFInt32 mth 0
field SFInt32 yar 0
field SFNode heure USE str_heure
field SFNode minute USE str_minute
field SFNode seconde USE str_seconde
field SFNode date USE str_date
field MFString jour ["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"]
field MFString mois ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]
url "javascript:
function set_startTime() {
Date = new Date() ;
hrs = Date.getHours() ;
if ( hrs < 10 ) { heure.string = new MFString( '0' + hrs ) ; }
else heure.string = new MFString( hrs ) ;
min = Date.getMinutes() ;
if ( min < 10 ) { minute.string = new MFString( '0' + min ) ; }
else minute.string = new MFString( min ) ;
sec = Date.getSeconds() ;
if ( sec < 10 ) { seconde.string = new MFString( '0' + sec ) ; }
else seconde.string = new MFString( sec ) ;
day = Date.getDay() ; nbr = Date.getDate() ; mth = Date.getMonth() ; yar = 1900 + Date.getYear() ;
if ( nbr < 10 ) { date.string = new MFString( jour[day] +' '+ ( '0' + nbr ) +' '+ mois[mth] +' '+ yar ) ; }
else date.string = new MFString( jour[day] +' '+ nbr +' '+ mois[mth] +' '+ yar ) ;
}
"
}
ROUTE TimeSensor.time TO Script.set_startTime
PS: j'ai bien vue la date du posteur et je suis déjà parti voir ailleur autre chose dans style no_cache.
<?php
if (!$test) { header ("Content-type: model/vrml"); }
?>
#VRML V2.0 utf8 Copyright © 2007, magnus
DEF Appearance Appearance { material Material { diffuseColor 1 0 0 emissiveColor 1 0 0 } }
DEF FontStyle FontStyle { justify "MIDDLE" style"BOLD" }
Transform { translation -2 0 0 children [ Shape { geometry DEF str_heure Text { string "00" fontStyle USE FontStyle } appearance USE Appearance } ] }
Transform { translation -1 0 0 children [ DEF point Shape { geometry Text { string ":" fontStyle USE FontStyle } appearance USE Appearance } ] }
Transform { translation 0 0 0 children [ Shape { geometry DEF str_minute Text { string "00" fontStyle USE FontStyle } appearance USE Appearance } ] }
Transform { translation 1 0 0 children [ USE point ] }
Transform { translation 2 0 0 children [ Shape { geometry DEF str_seconde Text { string "00" fontStyle USE FontStyle } appearance USE Appearance } ] }
Transform { translation 0 1 0 children [ Shape { geometry DEF str_date Text { string "jour date mois année" fontStyle USE FontStyle } appearance USE Appearance } ] }
DEF TimeSensor TimeSensor { loop TRUE }
DEF Script Script {
eventIn SFTime set_startTime
field SFInt32 hrs 0 field SFInt32 min 0 field SFInt32 sec 0
field SFInt32 day 0
field SFInt32 nbr 0
field SFInt32 mth 0
field SFInt32 yar 0
field SFNode heure USE str_heure
field SFNode minute USE str_minute
field SFNode seconde USE str_seconde
field SFNode date USE str_date
field MFString jour ["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"]
field MFString mois ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]
url "javascript:
function set_startTime() {
Date = new Date() ;
hrs = Date.getHours() ;
if ( hrs < 10 ) { heure.string = new MFString( '0' + hrs ) ; }
else heure.string = new MFString( hrs ) ;
min = Date.getMinutes() ;
if ( min < 10 ) { minute.string = new MFString( '0' + min ) ; }
else minute.string = new MFString( min ) ;
sec = Date.getSeconds() ;
if ( sec < 10 ) { seconde.string = new MFString( '0' + sec ) ; }
else seconde.string = new MFString( sec ) ;
day = Date.getDay() ; nbr = Date.getDate() ; mth = Date.getMonth() ; yar = 1900 + Date.getYear() ;
if ( nbr < 10 ) { date.string = new MFString( jour[day] +' '+ ( '0' + nbr ) +' '+ mois[mth] +' '+ yar ) ; }
else date.string = new MFString( jour[day] +' '+ nbr +' '+ mois[mth] +' '+ yar ) ;
}
"
}
ROUTE TimeSensor.time TO Script.set_startTime
PS: j'ai bien vue la date du posteur et je suis déjà parti voir ailleur autre chose dans style no_cache.