####################################################################################################
#
# Invoking X3D model self-test:
#
# $ python HelloWorld.py
#
# Python package x3d.py package is available on PyPI for import.
# This approach simplifies Python X3D deployment and use.
# https://pypi.org/project/x3d
#
# Installation:
# pip install x3d
# or
# python -m pip install x3d
#
# Developer options for loading x3d package in other Python programs:
#
# from x3d import * # preferred approach, terser source that avoids x3d.* class prefixes
#
# or
# import x3d # traditional way to subclass x3d package, all classes require x3d.* prefix,
# # but python source is very verbose, for example x3d.Material x3d.Shape etc.
# # X3dToPython.xslt stylesheet insertPackagePrefix=true supports this option.
#
####################################################################################################
from x3d import *
# comment preceding root node
newModel=X3D(profile='Immersive',version='3.3',
head=head(
children=[
meta(content='HelloWorld.x3d',name='title'),
meta(content='Simple X3D scene example: Hello World!',name='description'),
meta(content='30 October 2000',name='created'),
meta(content='31 October 2019',name='modified'),
meta(content='Don Brutzman',name='creator'),
meta(content='HelloWorld.tall.png',name='Image'),
meta(content='http://en.wikipedia.org/wiki/Hello_world',name='reference'),
meta(content='https://en.wikipedia.org/wiki/Hello#.22Hello.2C_World.22_computer_program',name='reference'),
meta(content='https://en.wikipedia.org/wiki/"Hello,_World!"_program',name='reference'),
meta(content='http://en.wikibooks.org/w/index.php?title=Computer_Programming/Hello_world',name='reference'),
meta(content='http://www.HelloWorldExample.net',name='reference'),
meta(content='http://www.web3D.org',name='reference'),
meta(content='http://www.web3d.org/realtime-3d/news/internationalization-x3d',name='reference'),
meta(content='http://www.web3d.org/x3d/content/examples/HelloWorld.x3d',name='reference'),
meta(content='http://X3dGraphics.com/examples/X3dForAdvancedModeling/HelloWorldScenes',name='reference'),
meta(content='http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorld.x3d',name='identifier'),
meta(content='http://www.web3d.org/x3d/content/examples/license.html',name='license'),
meta(content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit',name='generator'),
# Alternate encodings: VRML97, X3D ClassicVRML Encoding, X3D Compressed Binary Encoding (CBE), X3DOM, JSON
meta(content='HelloWorld.wrl',name='reference'),
meta(content='HelloWorld.x3dv',name='reference'),
meta(content='HelloWorld.x3db',name='reference'),
meta(content='HelloWorld.xhtml',name='reference'),
meta(content='HelloWorld.json',name='reference')]),
Scene=Scene(
# Example scene to illustrate X3D nodes and fields (XML elements and attributes)
children=[
WorldInfo(title='Hello World!'),
WorldInfo(title="Hello ' apostrophe 1"),
WorldInfo(title="Hello ' apostrophe 2"),
WorldInfo(title='Hello " quotation mark 3'),
WorldInfo(title='Hello " quotation mark 4'),
MetadataSet(name="items'",
value=[
MetadataInteger(name='one',value=[1]),
MetadataInteger(name='two',value=[2])]),
Group(
children=[
Viewpoint(DEF='ViewUpClose',centerOfRotation=(0,-1,0),description='Hello world!',position=(0,-1,7)),
# insert commas to test removal when converted to ttl
Transform(DEF='TestWhitespaceCommas',rotation=(0,1,0,3),
children=[
Shape(
geometry=Sphere(),
appearance=Appearance(
material=Material(DEF='MaterialLightBlue',diffuseColor=(0.1,0.5,1)),
texture=ImageTexture(DEF='ImageCloudlessEarth',url=["earth-topo.png","earth-topo.jpg","earth-topo-small.gif","http://www.web3d.org/x3d/content/examples/Basic/earth-topo.png","http://www.web3d.org/x3d/content/examples/Basic/earth-topo.jpg","http://www.web3d.org/x3d/content/examples/Basic/earth-topo-small.gif"])))]),
Transform(translation=(0,-2,0),
children=[
Shape(
geometry=Text(DEF='TextMessage',string=["Hello","world!"],
fontStyle=FontStyle(justify=["MIDDLE","MIDDLE"])),
appearance=Appearance(
material=Material(USE='MaterialLightBlue')))])])])
) # X3D model complete
####################################################################################################
# Self-test diagnostics
####################################################################################################
print('Self-test diagnostics for HelloWorld.py:')
if metaDiagnostics(newModel): # built-in utility method in X3D class
print(metaDiagnostics(newModel)) # display meta info, hint, warning, error, TODO values in this model
# print('check newModel.XML() serialization...')
newModelXML= newModel.XML() # test export method XML() for exceptions during export
newModel.XMLvalidate()
# print(newModelXML) # diagnostic
try:
# print('check newModel.VRML() serialization...')
newModelVRML=newModel.VRML() # test export method VRML() for exceptions during export
# print(prependLineNumbers(newModelVRML)) # debug
print("Python-to-VRML export of VRML output successful", flush=True)
except Exception as err: # usually BaseException
# https://stackoverflow.com/questions/18176602/how-to-get-the-name-of-an-exception-that-was-caught-in-python
print("*** Python-to-VRML export of VRML output failed:", type(err).__name__, err)
if newModelVRML: # may have failed to generate
print(prependLineNumbers(newModelVRML, err.lineno))
try:
# print('check newModel.JSON() serialization...')
newModelJSON=newModel.JSON() # test export method JSON() for exceptions during export
# print(prependLineNumbers(newModelJSON)) # debug
print("Python-to-JSON export of JSON output successful (under development)")
except Exception as err: # usually SyntaxError
print("*** Python-to-JSON export of JSON output failed:", type(err).__name__, err)
if newModelJSON: # may have failed to generate
print(prependLineNumbers(newModelJSON,err.lineno))
print("python HelloWorld.py load and self-test diagnostics complete.")
"Is that how you feel?" Arthur enquired. He came nearer still, as though to hear better. But the other got into a muddle with his affirmative. He flapped an ear in staccato fashion, and Arthur hastily withdrew. Louvain had been destroyed because a crowd of wanton soldiers, who were garrisoned there, who hated the Belgians, and who had been kept within bounds with difficulty, seized on their own stupid mistake to give rein to their passions. That sounds well, doesn't it, Daddy? But I don't wish to mislead you. or not so long as they are pretty? One can't help thinking, though, 247 “I’m not worrying about Jeff.” Larry was caught by the suspicious action of their “detective” in taking the day watch while nothing occurred at night. It was characteristic of Felipa that she forgot him altogether and reread the letter, her breath coming in audible gasps. He listened in agony to the regiment on the right marching off, to the cautions and admonitions given those who were carrying off the badly-wounded, and then to Lieut. Bowersox starting off with the right of the 200th Ind. "No," answered the Lieutenant. "This is the place where we intended to get off. We were quietly getting out so as to attract no notice when you started your circus. I saw you were doing well, hiving those fellows together, so I let you go ahead, while I slipped the boys around to gather them all in. Pretty neat job for a starter, wasn't it?" "Great Scott!" gasped Si, "you couldn't be walkin' around with the side of your head knocked out. I'm astonished at you." She smiled suddenly as she finished speaking. It was a sweet smile, rather aloof, but lighting up the whole of her face with a sudden flash of youth and kindness. Richard gazed at her, half fascinated, and mumbled lamely—"you're welcome, ma'am." Suddenly Backfield's fist crashed into Realf's body, full on the mark. The wind rushed out of him as out of a bellows, and he doubled up like a screen. This time he made no effort to rise; he lay motionless, one arm thrown out stiff and jointless as a bough, while a little blood-flecked foam oozed from between his teeth. Margaret was so shocked and overpowered, that she obeyed. HoME先费看欧美一级1片
ENTER NUMBET 0018pangbi.com.cn
b007.com.cn
www.falper.com.cn
liujitang.com.cn
161777.org.cn
lanigem.com.cn
www.dreamvr.com.cn
www.eveasy.com.cn
www.bjangel.com.cn
oibn.com.cn