时间: 2021-07-31 作者:daque
有年前自己发端从事三维动画上面的进修,后进修了php,创造不妨经过php动静天生vrml文书档案,有点一致于generator动静天生flash的办法。 因为vrml博大精炼,这边只引见一个大略的例子,还不妨将百般vrml结点惠存数据库中,如许的假造实际网页将……,爽! 底下是源步调。提防:在效劳器上,要将让php处置wrl方法的文书档案,要不成果将是没有任何假造实际。根源步调径直存成wrl文献,在欣赏器中要安置插件,不妨到我的另一个网页上去载入:http://go.163.com/~sjtucaocao/ <?php header("content-type: application/x-vrml");$txt="#vrml v2.0 utf8 def leftbox transform { translation -5 0 0 children [ shape { appearance appearance { material material { diffusecolor 1 0 0 } } geometry box{} } def spherechild shape { appearance appearance { material material { diffusecolor 1 0 1 } } geometry sphere { radius 1.2 } } ] } def rightbox transform { translation 5 0 0 children [ shape { appearance appearance { material material { diffusecolor 0 0 1 } } geometry box{} } ] } def onoff transform { translation 0 -1 0 children [ shape { appearance appearance { material material { diffusecolor 0 1 0 } } geometry box{} } def ts touchsensor{} ] } def s script { eventin sfbool isactive eventout mfnode child field mfnode testnode use spherechild url "javascript: function isactive(value) { if (value) { child=testnode; } } " } route ts.isactive to s.isactive route s.child to leftbox.removechildren route s.child to rightbox.addchildren";echo $txt; ?>