Create a Web system that dynamically outputs the 3D markup language up to the last time.
I'm relatively used to it, so I'll try to make it quickly using Flask in Python.
Since it is a large scale to access the database and use the API, I will try to make a clock that displays the access time as a minimum as PoC. Below is a program that displays the spheres that correspond to the hours, minutes, and seconds. It does not move with the passage of time.
app.py
from flask import Flask
import datetime
import math
app = Flask(__name__)
@app.route('/')
def clock():
dt_now = datetime.datetime.now()
hour = dt_now.hour % 12
minute = dt_now.minute
sec = dt_now.second
yh = 0.2 * math.cos(hour * 2 * 3.141592 / 12)
xh = 0.2 * math.sin(hour * 2 * 3.141592 / 12)
ym = 0.4 * math.cos(minute * 2 * 3.141592 / 60)
xm = 0.4 * math.sin(minute * 2 * 3.141592 / 60)
ys = 0.35 * math.cos(sec * 2 * 3.141592 / 60)
xs = 0.35 * math.sin(sec * 2 * 3.141592 / 60)
homl = '''<homl><head><title>CLOCK</title></head>
<body><a-scene wx=0.2 wy=0.2 wz=0.2>
<a-sphere r=0.05 x=0 y=0 z=0 color=white />
<a-sphere r=0.05 x={xh} y={yh} z=0 color=red />
<a-sphere r=0.03 x={xm} y={ym} z=0 color=green />
<a-sphere r=0.01 x={xs} y={ys} z=0 color=blue />
</a-scene></body></homl>
'''.format(xh=xh,yh=yh,xm=xm,ym=ym,xs=xs,ys=ys)
return homl
if __name__ == '__main__':
app.run()
It became like that. Now the world of the Internet and the world of XR are easily connected.