• momorprods

    great job @cvp ! currently working onto loading collada files, might take most of my upcoming oversea flight! I’ll keep you posted.

    posted in Pythonista read more
  • momorprods

    ah sorry my bad, In my tests I tweaked badly my SCNVector3 using c_double instead of c_float. Fixed and working now.

    posted in Pythonista read more
  • momorprods

    @cvp I think there is still something weird, as the coordinates of the vertices really don’t match what’s expected. The triangle totally disappear if I just scale the Z value of the 1st vertice, which is not normal.

    And overall the size of the triangle is not what it should be (confirmed this by overlapping a cube box and also by estimating through the ARKit rendering).

    Since it shows the triangle, the indexing part of the code must be ok - it probably deals with the SCNVector3 array. Perhaps I’m wrong, but SCNVector3 looks like an ObjC class, not a C record?

    posted in Pythonista read more
  • momorprods

    guys you are genius. Not sure why the vertex order did change something, probably it needs to be defined clockwise or something like that.

    Thanks for all of your help, you are awesome!

    posted in Pythonista read more
  • momorprods

    @cvp @JonB thanks for your help, I am going to investigate that empty scene stuff.

    posted in Pythonista read more
  • momorprods

    Making some good progress thanks to your help. But I’m getting a last crash on the very last instruction - any idea?

    #triangle generation
    verts=[SCNVector3(0, 0, 0), SCNVector3(1, 0, 0), SCNVector3(0, 1, 0)]
    verts_array = (SCNVector3 * len(verts))(*verts)
    
    src = ObjCClass('SCNGeometrySource').geometrySourceWithVertices_count_(
        verts_array,len(verts),
        restype=c_void_p,
        argtypes=[POINTER(SCNVector3), c_ulong],)
        
    indexes=[0,1,2]
    indexes_array = (c_ulong*len(indexes))(*indexes)
    datIndexes = ObjCClass('NSData').dataWithBytes_length_(indexes_array,len(indexes_array))
     
    ele=ObjCClass('SCNGeometryElement').geometryElementWithData_primitiveType_primitiveCount_bytesPerIndex_(datIndexes,SCNGeometryPrimitiveTypeTriangles,1,4)
       
    # CRASH Here: 
    geo = ObjCClass('SCNGeometry').geometryWithSources_elements_(src,ele)

    posted in Pythonista read more
  • momorprods

    wooohoooo thanks!!

    posted in Pythonista read more
  • momorprods

    Made this, but still crashing. Am I making another noob mistake?

    verts=[0.0,0.0,0.0 , 1.0,0.0,0.0 , 0.0,1.0,0.0]
    arr = (ctypes.c_float * len(verts))(*verts)
    src = SCNGeometrySource.geometrySourceWithVertices_count_(byref(arr),3)

    posted in Pythonista read more
  • momorprods

    oh ok thanks, going to try that and keep you posted!

    posted in Pythonista read more
  • momorprods

    hehe yep made my day! Struggling now into loading SceneKit SCN file, did anyone had chance with this?

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!