omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. adem
    3. Posts

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by adem

    • Drawing a triangle GLKit

      So I am trying to draw my first triangle using GLKit, but it’s not showing

      def Vertex(x = c_float, y = c_float, z = c_float, r = c_float, g = c_float, b = c_float, a = c_float):
              restype = None
              argtypes = [x, y, z, r, g, b, a]
              cfunc = c.glRotatef
              cfunc.restype = restype
              #cfunc.argtypes = argtypes
              return argtypes
      Vertices = [
        Vertex(x=  1, y= -1, z= 0, r= 1, g= 0, b= 0, a= 1),
        Vertex(x=  1, y=  1, z= 0, r= 0, g= 1, b= 0, a= 1),
        Vertex(x= -1, y=  1, z= 0, r= 0, g= 0, b= 1, a= 1),
        Vertex(x= -1, y= -1, z= 0, r= 0, g= 0, b= 0, a= 1),
      ]
      
      vf = [
         -1.0, -1.0, 0.0,
         1.0, -1.0, 0.0,
         0.0,  1.0, 0.0,
      	]
      intvf = [
         -1, -1, 0,
         1, -1, 0,
         0,  1, 0,
      	]
      vertdata = (ctypes.c_float * len(vf))(*vf)
      #print(dir(c))
      
      def glkView_drawInRect_(_self, _cmd, view, rect):
          r, g, b = colorsys.hsv_to_rgb((time.time() * 0.1) % 1.0, 1, 1)
          glClearColor(r, g, b, 1.0)
          vertexBuffer = GLES1.GLuint()
          GLES2.glGenBuffers(1, ctypes.byref(vertexBuffer), GLES1.GLsizei, ctypes.POINTER(GLES1.GLuint))
          GLES2.glBindBuffer(GLES2.GL_ARRAY_BUFFER, vertexBuffer)
          v = vertdata
          lv = len(v)
          va = (GLES2.GLfloat * len(v))
          GLES2.glBufferData(
          GLES2.GL_ARRAY_BUFFER,
          lv,
          v,
          GLES2.GL_STATIC_DRAW,
          voiddata_t=va)
          #self.vertexBuffer = vertexBuffer
          #_loaded_vbos[self.file] = {frame_id: vertexBuffer}
          GLES2.glBindBuffer(GLES2.GL_ARRAY_BUFFER, 0)
          
          GLES2.glEnableVertexAttribArray(0);
          GLES2.glDrawArrays(GLES2.GL_TRIANGLES, 0, 3);
          
          glClear(GL_COLOR_BUFFER_BIT) 
      
      posted in Pythonista
      adem
      adem
    • RE: Stream camera to webview

      The rtsp issue seems to have not been resolved
      And the safari view controller seems to be a viable option but i can’t really edit much

      posted in Pythonista
      adem
      adem
    • Stream camera to webview

      Hello,
      I just started using pythonista and I can vouch that it's the best app on AppStore right now.

      Kudos to the team behind this amazing app!

      Now my question is given the limitations of the ui.webview not being able to process camera unlike safari, so how can I stream a camera as a url to the webview because that seems like an obvious solution

      posted in Pythonista
      adem
      adem