picogl.examples.devel.legacy_shader =================================== .. py:module:: picogl.examples.devel.legacy_shader Attributes ---------- .. autoapisummary:: picogl.examples.devel.legacy_shader.Template picogl.examples.devel.legacy_shader.quad_verts picogl.examples.devel.legacy_shader.quad_indices picogl.examples.devel.legacy_shader.model picogl.examples.devel.legacy_shader.view picogl.examples.devel.legacy_shader.proj picogl.examples.devel.legacy_shader.template_src picogl.examples.devel.legacy_shader.template picogl.examples.devel.legacy_shader.rotation Functions --------- .. autoapisummary:: picogl.examples.devel.legacy_shader.update_projection picogl.examples.devel.legacy_shader.render_vertex_with_template picogl.examples.devel.legacy_shader.mouse picogl.examples.devel.legacy_shader.motion picogl.examples.devel.legacy_shader.keyboard picogl.examples.devel.legacy_shader.create_vertex_program picogl.examples.devel.legacy_shader.init_gl picogl.examples.devel.legacy_shader.display picogl.examples.devel.legacy_shader.render picogl.examples.devel.legacy_shader.reshape picogl.examples.devel.legacy_shader.main Module Contents --------------- .. py:data:: Template :value: None .. py:data:: quad_verts .. py:data:: quad_indices :value: [(0, 1, 2), (2, 3, 0)] .. py:data:: model .. py:data:: view .. py:data:: proj .. py:function:: update_projection(width, height) .. py:data:: template_src :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """def process_vertex(v, mvp_matrix): # Position processing pos = np.array(v['pos'] + [1.0]) gl_pos = (mvp_matrix @ pos).tolist() # Color processing: {{ color_mode }} {% if color_mode == "vertex_color" %} colour = v['colour'] {% elif color_mode == "normal_based" %} n = np.array(v['normal'], dtype=float) n_norm = n / np.linalg.norm(n) if np.linalg.norm(n) != 0 else n colour = [(n_norm[0]*0.5)+0.5, (n_norm[1]*0.5)+0.5, (n_norm[2]*0.5)+0.5] {% elif color_mode == "custom" %} colour = {{ custom_color_expression }} {% endif %} return {'gl_pos': gl_pos, 'colour': colour}""" .. raw:: html
.. py:data:: template .. py:function:: render_vertex_with_template(v, mvp) .. py:data:: rotation .. py:function:: mouse(button, state, x, y) .. py:function:: motion(x, y) .. py:function:: keyboard(key, x, y) .. py:function:: create_vertex_program(color_mode, custom_expr=None) .. py:function:: init_gl() .. py:function:: display() .. py:function:: render(mvp_matrix, vertex_processor) .. py:function:: reshape(width, height) .. py:function:: main()