INFO: Time for setup and init of GL element no. 1: 46 ms.
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 null/defaultX3DNavigationInfoNode
INFO: register NavigationInfoBindable null/defaultX3DNavigationInfoNode
INFO: NavType: examine
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: addEventListener for X3D.onDOMNodeInserted
INFO: addEventListener for X3D.onDOMNodeRemoved
INFO: webgl 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 1.0 (OpenGL ES 2.0 Chromium), ShadingLangV.: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium), MSAA samples: 4
Extensions: ANGLE_instanced_arrays, EXT_blend_minmax, EXT_clip_control, EXT_color_buffer_half_float, EXT_depth_clamp, EXT_float_blend, EXT_frag_depth, EXT_polygon_offset_clamp, EXT_shader_texture_lod, EXT_texture_compression_bptc, EXT_texture_compression_rgtc, EXT_texture_filter_anisotropic, EXT_texture_mirror_clamp_to_edge, EXT_sRGB, OES_element_index_uint, OES_fbo_render_mipmap, OES_standard_derivatives, OES_texture_float, OES_texture_float_linear, OES_texture_half_float, OES_texture_half_float_linear, OES_vertex_array_object, WEBGL_color_buffer_float, 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_depth_texture, WEBGL_draw_buffers, WEBGL_lose_context, WEBGL_multi_draw, WEBGL_polygon_mode
INFO: Initializing X3DCanvas for [x3dom-1736124079587-canvas]
INFO: Creating canvas for (X)3D element...
INFO: Time for setup and init of GL element no. 0: 27 ms.
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 null/defaultX3DNavigationInfoNode
INFO: register NavigationInfoBindable null/defaultX3DNavigationInfoNode
INFO: NavType: examine
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: addEventListener for X3D.onDOMNodeInserted
INFO: addEventListener for X3D.onDOMNodeRemoved
INFO: webgl 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 1.0 (OpenGL ES 2.0 Chromium), ShadingLangV.: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium), MSAA samples: 4
Extensions: ANGLE_instanced_arrays, EXT_blend_minmax, EXT_clip_control, EXT_color_buffer_half_float, EXT_depth_clamp, EXT_float_blend, EXT_frag_depth, EXT_polygon_offset_clamp, EXT_shader_texture_lod, EXT_texture_compression_bptc, EXT_texture_compression_rgtc, EXT_texture_filter_anisotropic, EXT_texture_mirror_clamp_to_edge, EXT_sRGB, OES_element_index_uint, OES_fbo_render_mipmap, OES_standard_derivatives, OES_texture_float, OES_texture_float_linear, OES_texture_half_float, OES_texture_half_float_linear, OES_vertex_array_object, WEBGL_color_buffer_float, 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_depth_texture, WEBGL_draw_buffers, WEBGL_lose_context, WEBGL_multi_draw, WEBGL_polygon_mode
INFO: Initializing X3DCanvas for [x3dom-1736124079529-canvas]
INFO: Creating canvas for (X)3D element...
INFO: Found 2 X3D and 0 (experimental) WebSG nodes...
INFO: X3DOM version 1.7.2-dev, Revison 442d7e8f2b8dfbb83706c9a6c92c4dcb47054f25, Date Mon Mar 14 11:46:12 2016 +0100
Comments
3D egocentric rotation
One powerful (sometimes interpreted as limited) aspect of logo is its egocentric movement (e.g., FD, BK, LT, RT). In VRMath2, I added RU (RollUp), RD (RollDown), TR (TiltRight) and TL (TiltLeft). With the 6 egocentric rotations, it is easy to create spirals or spiralgraphs...
Have you seen my simply bouncing spring? https://vrmath2.net/content/bouncing-spring
And thanks to you the Text (Label) works pretty well.
only right turns
Hm, this only uses right turns after an initial roll up. Still not sure how the initial transform rotation is determined.
center of transform
The center attribute in the transform will apply to its childrem as specified in the x3d spec... My earlier design is that when an empty TRANSFORM node is created, I apply the turtle's position to the transform's translation. Later I found that is not good for SPIN command so instead I apply the turtle's position to the transform's center.
I think the surprise is the turtle is actually deviated from the line and objects. That is because all the nested transforms' centers added up to create the translation. The rotation is the result of RT 20 in 5 repeats...
How should the default empty TRANSFORM be created in relation to the turtle's position and orientation can be discussed. Perhaps I need to apply the turtle's orientation to the transform's rotation too.
transform
After experimenting some more with transform setparent I think that part of the surprising behaviour is that the rotation of the turtle is applied to both the parent transform and also the wrapping transform around an inserted primitive. In effect, this leads to a doubled rotation. I updated the blog with a much simpler world which illustrates. So, I think, it would be better to not apply the current rotation to a new parent transform. The center field could still be populated. The spin command would reset the initial rotation in any case.
double rotation
I did see the double rotation effect now, am wondering if this is supposed to be with the center attribtue... I did also apply the turtle's orientation to the transform's rotation.
I have changed VRMath2 not to apply translation on the center attribute. You may be supprised with the results again.
I am also surprised that you found the syntax for primitives. I thought that I did not have any examples but in the reference... is that where you found it?
Below is an experiment I did when implement the brackets on primitives. The brackets mean that the command can take any number of inputs.
primitives
The center attribute is just a translation before the rotation is applied. It is then undone as well. The full sequence of a transfrom is:
1) negative center translation (to move the center to the origin for rotation)
2) inverse scale orientation rotation (to align the axis for scaling)
3) scaling
4) undo inverse scale orientation rotation (was just for scaling)
5) rotation (about the specified center, now at origin)
6) undo negative center translation (was just for rotation/scaling)
7) translation
http://www.web3d.org/documents/specifications/19775-1/V3.2/Part01/compon...
So there can be a lot going on but it is the logical sequence for a combined transform.
The primitives support is cool. I did find the short syntax for attributes in the reference guide which explained it well.
Design issue
Hm.. I think this is a design issue for VRMath2's programming. I thought that the turtle's position and orientation could be utilised when creating objects including an empty transform. BTW, every primitive object has a transform node when created.
The reason I am still applying turtle's orientation to empty transform's rotation is for some animation particularly for my SPIN command. The SPIN command generate keyvalues (of orientationinterpolator) based on the six directions (of the 3 axes).
For example, I can create a rotating earth by:
Then if I need to apply a 23.5 tilt, I would use a parent transform to achieve it. For example:
Of course there are other ways to have a rotating earth tilting 23.5 degrees. I could simply tiltright 23.5, then rotate the turtle left to collect a few orientations then apply to an orientationinterpolator. This way I do not even need a parent transform. This was the old way I did in https://vrmath2.net/content/rotating-earth-orbiting-sun .
Whether or not to apply turtle's rotation to empty transform's rotation can be discussed. Afterall, if I set default to not apply, it is still easy to apply with one or two more commands.. such as