Übungen
Übungen
Aufgabe 1
Baue einen Kreis aus 90 Kugeln:
- FPS0.00
- ANIM0.00
- TRAVERSE0.70
- SORT0.00
- RENDER3.80
- DRAW0.04
- #NODES:186
- #SHAPES:91
- #DRAWS:91
- #POINTS:56,875
- #TRIS:104,832
- #ACTIVE0
- #TOTAL0
- #LOADED0
- #FAILED0
Schreibe ein Hilfsprogramm (z.B. mit Python), dass dir den X3D-Code für einen solchen Kreis ausgibt.
Hilfen:
- Definiere eine Kugel mit einer goldenen Farbe als
Shape
. - Sinus und Kosinus können die Position des Kreismittelpunktes berechnen.
- Beachte, dass z.B. math.sin() in Python mit dem Bogenmaß arbeitet (also Winkel * pi / 180).
- Verschiebe die Kugel an den Mittelpunkt des Kreises.
Aufgabe 2
Definiere den fertigen Kreis aus Aufgabe 1 (jetzt erst einmal nur mit 30 Kugeln) als Gruppe und drehe diese mehrfach um die y-Achse zu einer Kugel:
INFO: Time for setup and init of GL element no. 1: 60 ms.
INFO: activate FogBindable null/defaultX3DFogNode
INFO: register FogBindable null/defaultX3DFogNode
INFO: create new Fog for X3DFogNode-stack
INFO: activate ViewpointBindable null/defaultX3DViewpointNode
INFO: register ViewpointBindable null/defaultX3DViewpointNode
INFO: create new Viewpoint for X3DViewpointNode-stack
INFO: activate BackgroundBindable null/defaultX3DBackgroundNode
INFO: register BackgroundBindable null/defaultX3DBackgroundNode
INFO: create new Background for X3DBackgroundNode-stack
INFO: System ready.
INFO: activate NavigationInfoBindable head/
INFO: activate first X3DNavigationInfoNode for X3DNavigationInfoNode-stack
INFO: activate EnvironmentBindable null/defaultX3DEnvironmentNode
INFO: register EnvironmentBindable null/defaultX3DEnvironmentNode
INFO: create new Environment for X3DEnvironmentNode-stack
INFO: register NavigationInfoBindable head/
INFO: NavType: undefined
INFO: Switch to examine mode.
INFO: addEventListener for X3D.onDOMNodeInserted
INFO: addEventListener for X3D.onDOMNodeRemoved
INFO: webgl2 context found Vendor: WebKit Google Inc. (Google), Renderer: WebKit WebGL ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (LLVM 10.0.0) (0x0000C0DE)), SwiftShader driver), Version: WebGL 2.0 (OpenGL ES 3.0 Chromium), ShadingLangV.: WebGL GLSL ES 3.00 (OpenGL ES GLSL ES 3.0 Chromium), MSAA samples: 4 Extensions: EXT_clip_control, EXT_color_buffer_float, EXT_color_buffer_half_float, EXT_conservative_depth, EXT_depth_clamp, EXT_float_blend, EXT_polygon_offset_clamp, EXT_texture_compression_bptc, EXT_texture_compression_rgtc, EXT_texture_filter_anisotropic, EXT_texture_mirror_clamp_to_edge, EXT_texture_norm16, NV_shader_noperspective_interpolation, OES_draw_buffers_indexed, OES_sample_variables, OES_shader_multisample_interpolation, OES_texture_float_linear, OVR_multiview2, WEBGL_clip_cull_distance, WEBGL_compressed_texture_astc, WEBGL_compressed_texture_etc, WEBGL_compressed_texture_etc1, WEBGL_compressed_texture_s3tc, WEBGL_compressed_texture_s3tc_srgb, WEBGL_debug_renderer_info, WEBGL_debug_shaders, WEBGL_lose_context, WEBGL_multi_draw, WEBGL_polygon_mode, WEBGL_stencil_texturing
INFO: Initializing X3DCanvas for [x3dom-1744104971392-canvas]
WARNING: The width attribute is to be specified in pixels not in percent.
INFO: Inline X3D styles detected
INFO: Creating canvas for (X)3D element...
INFO: Time for setup and init of GL element no. 0: 73 ms.
INFO: activate FogBindable null/defaultX3DFogNode
INFO: register FogBindable null/defaultX3DFogNode
INFO: create new Fog for X3DFogNode-stack
INFO: activate ViewpointBindable null/
INFO: activate first X3DViewpointNode for X3DViewpointNode-stack
INFO: activate BackgroundBindable null/defaultX3DBackgroundNode
INFO: register BackgroundBindable null/defaultX3DBackgroundNode
INFO: create new Background for X3DBackgroundNode-stack
INFO: System ready.
INFO: activate NavigationInfoBindable null/defaultX3DNavigationInfoNode
INFO: register NavigationInfoBindable null/defaultX3DNavigationInfoNode
INFO: NavType: undefined
INFO: Switch to examine mode.
INFO: create new NavigationInfo for X3DNavigationInfoNode-stack
INFO: activate EnvironmentBindable null/defaultX3DEnvironmentNode
INFO: register EnvironmentBindable null/defaultX3DEnvironmentNode
INFO: create new Environment for X3DEnvironmentNode-stack
INFO: register ViewpointBindable null/
INFO: addEventListener for X3D.onDOMNodeInserted
INFO: addEventListener for X3D.onDOMNodeRemoved
INFO: webgl2 context found Vendor: WebKit Google Inc. (Google), Renderer: WebKit WebGL ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (LLVM 10.0.0) (0x0000C0DE)), SwiftShader driver), Version: WebGL 2.0 (OpenGL ES 3.0 Chromium), ShadingLangV.: WebGL GLSL ES 3.00 (OpenGL ES GLSL ES 3.0 Chromium), MSAA samples: 4 Extensions: EXT_clip_control, EXT_color_buffer_float, EXT_color_buffer_half_float, EXT_conservative_depth, EXT_depth_clamp, EXT_float_blend, EXT_polygon_offset_clamp, EXT_texture_compression_bptc, EXT_texture_compression_rgtc, EXT_texture_filter_anisotropic, EXT_texture_mirror_clamp_to_edge, EXT_texture_norm16, NV_shader_noperspective_interpolation, OES_draw_buffers_indexed, OES_sample_variables, OES_shader_multisample_interpolation, OES_texture_float_linear, OVR_multiview2, WEBGL_clip_cull_distance, WEBGL_compressed_texture_astc, WEBGL_compressed_texture_etc, WEBGL_compressed_texture_etc1, WEBGL_compressed_texture_s3tc, WEBGL_compressed_texture_s3tc_srgb, WEBGL_debug_renderer_info, WEBGL_debug_shaders, WEBGL_lose_context, WEBGL_multi_draw, WEBGL_polygon_mode, WEBGL_stencil_texturing
INFO: Initializing X3DCanvas for [x3dom-1744104971292-canvas]
WARNING: The width attribute is to be specified in pixels not in percent.
INFO: Inline X3D styles detected
INFO: Creating canvas for (X)3D element...
INFO: Found 2 X3D and nodes...
INFO: X3DOM version 1.8.1, Revison 0c742a1a981f8c0a9cbb7059f36c3a6c4cb9fec6, Date Fri Sep 27 18:22:15 2019 +0200
- FPS0.00
- ANIM0.00
- TRAVERSE2.50
- SORT0.00
- RENDER10.30
- DRAW0.02
- #NODES:993
- #SHAPES:481
- #DRAWS:481
- #POINTS:300,625
- #TRIS:554,112
- #ACTIVE0
- #TOTAL0
- #LOADED0
- #FAILED0
Aufgabe 3
Jetzt wird es schon komplizierter: Forme aus Netzen (Dreiecken) einen Ring:
Bild ist nicht interaktiv!
