Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Icosphere

edited April 2020 in Codea Craft Posts: 2,277

@Simeon - @John
Can someone refresh my memory - I recollect going through a whole series of sphere mapping alternatives to the one used in Craft some great work by forum members to create excellent detailed images. What I can’t remember was if we incorporated any learning in the Craft icosphere model. My reason being I just set up a textured sphere and tried a few images to check it out and found each sphere had a zip (see attached image). Do we need to add a new model or do I need better textures?

Tagged:

Comments

  • Posts: 643

    @Bri_G, yes, i think the native Codea icosphere is not correct. I therefore use the @LoopSpace version which is better. Someday i hope @John will fix that. I guess the sphere used in Shade is correct?

  • dave1707dave1707 Mod
    edited April 2020 Posts: 9,295

    @Bri_G Here's my version that I posted long ago. You can also zoom in to see the sphere from the inside.

    PS. I found the original link where I was creating the code.

    https://codea.io/talk/discussion/9133/craft-sphere-texture#latest
    
    displayMode(FULLSCREEN)
    
    function setup()  
        assert(OrbitViewer, "Please include Cameras (not Camera) as a dependency")        
        scene = craft.scene()
        v=scene.camera:add(OrbitViewer, vec3(0,0,0), 700, 0, 1000)
    
        myImg=readImage(asset.builtin.Surfaces.Basic_Bricks_Color)
    
        s1=createSphere(vec3(0,0,0),200,5,false,true,myImg)
    end
    
    function draw()
        update(DeltaTime)
        scene:draw()
    end
    
    function update(dt)
        scene:update(dt)
        s1.rotation = quat.eulerAngles(-90,0,0)
    end
    
    function createSphere(pos,size,level,flat,ins,image)
        local s=scene:entity()
        s.position=vec3(0,0,0)
        s.model = craft.model.icosphere(size,level,flat)
        s.material = craft.material(asset.builtin.Materials.Standard) 
        icoTexture(s,ins,image)
        return s
    end
    
    function icoTexture(sph,inside,img)
        local seam=0
        local ax,bx,cx,ay,by,cy,c,lat,lon  
        local posTab=sph.model.positions
        local pTab,cTab,nTab,llTab,uvTab,colTab,norTab,iTab={},{},{},{},{},{},{},{}
        local deg=math.deg
        local asin=math.asin
        local atan2=math.atan2
        sph.material.map=img 
    
        -- create tables for rounded icospheres        
        if not flat then
            iTab=sph.model.indices
            pTab=sph.model.positions
            cTab=sph.model.colors
            nTab=sph.model.normals  
            for a,b in pairs(iTab) do
                posTab[a]=pTab[b]
                colTab[a]=cTab[b]
                norTab[a]=nTab[b]
                iTab[a]=a
            end
        end 
    
        -- convert sphere positions to latitude and longitude
        for a,b in pairs(posTab) do
            c=b:normalize()
            lat=deg(asin(c.z))+90
            lon=deg(atan2(c.y,c.x))
            llTab[a]=vec2(lon,lat)     -- save lon, lat in table
            if lon//1==-149 then    -- get exact value of seam
                seam=lon
            end
        end 
    
        -- shift points on the left side of the seam to the right side 
        for a,b in pairs(llTab) do        
            b.x=b.x-seam
            if b.x<-.01 then
                b.x=b.x+360
            end
        end 
    
        -- shift individual points of triangle if needed  
        for z=1,#llTab,3 do
            ax,ay=llTab[z].x,llTab[z].y
            bx,by=llTab[z+1].x,llTab[z+1].y
            cx,cy=llTab[z+2].x,llTab[z+2].y
            if ax>250 or bx>250 or cx>250 then
                if ax<.01 then 
                    ax=360
                end
                if bx<.01 then
                    bx=360
                end
                if cx<.01 then
                    cx=360
                end  
            end  
            if ay==0 or ay==180 then
                ax=(bx+cx)*.5
            elseif by==0 or by==180 then
                bx=(ax+cx)*.5
            elseif cy==0 or cy==180 then
                cx=(ax+bx)*.5
            end  
    
            -- create uv table
            uvTab[z]=vec2(ax/360,ay/180)
            uvTab[z+1]=vec2(bx/360,by/180)
            uvTab[z+2]=vec2(cx/360,cy/180)
        end 
    
        -- reset tables 
        sph.model.uvs=uvTab
    
        if not flat then
            sph.model.indices=iTab
            sph.model.positions=posTab
            sph.model.colors=colTab
            sph.model.normals=norTab
        end
    
        --update indices table for inside view    
        if inside then
            iTab=sph.model.indices
            for z=#sph.model.indices,1,-1 do
                iTab[#iTab+1]=iTab[z]
            end
            sph.model.indices=iTab
        end
    end
    
  • edited April 2020 Posts: 2,277
    @piinthesky @dave1707 - thanks for that, confirmed my own recollection. I remember @LoopSpace tried a lot of different approaches shame we didn''t get an upgrade there. The Shade version does look to be complete, as you say, and should be transferable. In the meantime anyone know what the possible problems are in using sprites, meshes and Craft together?

    P.s. @dave1707 - thanks for the link and code, I need to re-read that to get back up to speed.
  • Posts: 2,277

    @dave1707 - simple idea, raised this thread again ‘cos I thought we may be able to improve on this issue. Not modifying the code as such, as it works fine, - no, my suggestion is to take the code, build the model and write it out as a file - an obj file. Then we can simply load it in one line of code. What do you think?

  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G All the info is in the tables (indices, positions, uvs, etc.). It would be just a matter of converting them to an obj format. That might be the sticky part.

  • Posts: 2,277

    @dave1707 - I’ll give it a try and post code and files later. Don’t hold you breath.

  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G I can create an obj file, but so far it’s not displaying anything when I use it. I’m still trying to figure out what’s going wrong.

  • edited June 13 Posts: 2,277
    @dave1707 - started looking at your project but, you know what it's like somebody else's code. Then I printed out the number of vertices, just less than 128,000.
    At that point I thought simplify, build crude one that works - then print out the obj file. Finally scale up to mid poly at least. So I've gone back to first principles and looking at ways to build up a sphere.
    Found a few interesting articles, and started to investigate sphere from a cube.
    In parallel also looking for free sphere obj model to get the display program working.
    Not much progress yet - if you want to post your obj file I'll check it out and see if I can find any flaws.
  • dave1707dave1707 Mod
    edited June 13 Posts: 9,295

    @Bri_G I was able to create the obj file for the icosphere. The only problem is the size. For a level 1, the obj file was 23,805 bytes. For level 2, 103,275. For level 3, 443,511. And level 4 was 1,850,847. It took what seemed like 5 minutes to create the level 4 file.

    PS. The file doesn’t contain the normals yet. I was going to put a zip file with the demo, but it doesn’t work right if I put the obj file in the project folder.

  • Posts: 2,277
    @dave1707 - creating the file isn't the issue, how quickly does it load into Craft? I wouldn't worry too much about the normals.
  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G I was able to add the normals to the file and get it to work with the project folder. Here’s the example for a level 1 icosphere. The obj file is a little bigger with the normals added.

    004b.zip 7.2K
  • edited June 13 Posts: 2,277
    @fave1707 - that's great. Loads up very quickly. Did you say this was level 4? I thought the face size would be smaller. I think when we look at the number of vertices involved and the time to create them we expect it to be smoother.

    I found a sphere obj file on the net will post a zip to you shortly. I'm just looking at texturing it.
  • dave1707dave1707 Mod
    edited June 13 Posts: 9,295

    @Bri_G It was a level 1. I mentioned that above even though the project is 004. A level 3 loads in less than 3 seconds and the obj is 645,753 bytes.

  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G Here’s the example for a level 3 icosphere. It loads fast from the project folder.

  • Posts: 2,277

    @dave1707 - the file, change .txt to .obj as forum won't accept it as .obj.

    sphere.txt 13.7K
  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G I haven’t tried your file yet. I don’t like my obj files because of the size for the higher level spheres. Also, the north and south poles of the sphere aren’t north and south, but on the equator. So the rotation doesn’t work right. What I did instead was make my createSphere program as a dependency. It can create a level 6 icosphere in less than a second and because it’s a dependency doesn’t show up as lines of code.

    I’ll try your sphere file later.

  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G Was able to use your file, less than a second to load. It looks like it’s between a level 1 and level 2 icosphere.

  • Posts: 2,277

    @dave1707 - yeah, deliberately playing with low poly so easier to handle but still a lot of lines in the file. Never thought about the sphere as a dependency. I’ve done that for lots of small low poly models in the past - should have thought about it before. Just going to look at options for sphere code now to see if I can find the best option. Dig through the old forum notes.

  • dave1707dave1707 Mod
    edited June 15 Posts: 9,295

    @Bri_G I gave up with the obj file. They’re too big for higher level icospheres. I changed my texture program so it can be used as a dependency (IcoCreate). Here’s the IcoCreate to be used as the dependency and IcoDemo that uses it.

    Edit: The dependency file IcoCreate.zip was removed and updated below.

  • edited June 15 Posts: 2,277

    @dave1707 - very neat and impressive, I think I”ll put my searching on the back burner now - your demo meets all my needs at moment.

    Notice you put a blank main in the dependency. I tend to use a demo including a Main useable tab for the dependency so I can check the demo without running a dedicated demo file as the Main in the dependency is ignored. Alternatively I use a simple text display stating what the dependency function is (makes them stand out a little against project files). Thanks for the help.

  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G I didn’t want to add my demo to Main because it was originally too big. I had to find a smaller world map to use than I have in my original demo. I also forgot to add the parameter documentation.

    s1 = icoSphere(pos,size,level,flat,ins,image)

    pos … vec3(x,y,z) x,y,z position of the sphere
    size … size of the sphere
    level … sphere level (1-6) higher values use more triangles to create sphere
    flat … (true or false) true shows trianglular surface, false shows smooth surface
    ins … (true or false) true shows reverse image when inside sphere, false doesn’t
    image … image to use as texture. Width should be twice the Height to keep ratio

  • Posts: 2,277

    @dave1707 - thanks again, figured out most of the parameters from the code but wasn’t quite sure of the two booleans.

  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G I updated the IcoCreate using your suggestion to include a demo in Main. I also added an option to choose material type (Basic, Standard, Specular). There are instructions on how to set the parameter values and if you don’t supply an image (nil) then a multi-colored sphere is created.

  • edited June 16 Posts: 2,277

    @dave1707 - excellent, neat finished product. I just added a few lines to print out for the project icon.


    font("Futura-CondensedExtraBold") fontSize(64) fill(255, 246, 0) text("Sphere Dependencies",WIDTH/2,HEIGHT/2)
  • Posts: 2,277

    @dave1707 - looking back resurrected an old @Jmv38 tutorial for spheres pre Craft. This goes through the creation of meshes and some optimisations on sphere texture code.

    @Steppers - I know it’s old hat but it is well put together and helpful for anyone getting into meshes. Images are provided off the net.

  • Posts: 185

    @Bri_G That’s actually a very nice walkthrough of the ideas. I really like it! Thanks for bringing it up again, it should be available on WebRepo now.

    On a related note I’d really appreciate it if you can submit projects using the google form, I’ve got a script setup for the form that saves me a lot of time processing submissions :smile: Cheers!

  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G I don’t remember seeing that before. When was it originally posted.

  • Posts: 2,277
    @dave1707 - the file I took it from was dated 10th August 2013. At the time I thought it was the bee's knees and still think it's an excellent example of mesh 3D.
  • edited June 17 Posts: 2,277

    @dave1707 - I asked @Simeon how we would compensate for loss of the structure function blah(…) but heard no reply. Could you outline the approach to this? I am trying to update another old demo with this structure present.

  • dave1707dave1707 Mod
    edited June 19 Posts: 9,295

    I’ve run into something I haven’t been able to figure out yet. Here’s some code that textures an icosphere and has an option to draw the lines of the triangles that makeup the icosphere.

    The problem: for icospheres 5 and above, it doesn’t draw all the triangles. As far as I can tell all the info is there because the textured icospheres are drawn correctly. So if the texture is correct, why aren’t the triangles correct.

    To see the lines, slide the lines parameter. If you want to see a slow motion of the lines being drawn, slide the slow parameter. The slow isn’t that useful for the lower level icospheres.

    Change the value of the “level” variable from 0 thru 6 and run for each to see the issue.

    Hopefully I’m not doing something stupid.

    @Simeon or anyone, any suggestions.

    See updated code below
    
  • dave1707dave1707 Mod
    Posts: 9,295

    Something I think is happening with the above triangles. I think there’s a limit for the number of triangles (lines) that can be drawn. If I change the for loop in drawLines for a level 5 icosphere from 1 to 9997, it looks like the triangles that aren’t drawn starting at 1 are being drawn. Will continue with that thought.

  • Posts: 2,277

    @dave1707 - interesting, very impressive. I can confirm partial loss of sphere structure at level 5. Can you influence the lineWidth for the wireframe?

    Another issue I have noticed, and I may have seen this before with distortion of vertices so models don’t appear correct and distort when rotating, - set level to 4 and rotate the model no probs. Then set the wireFrame on - still looks good. Now switch textured back on - do you see the distortion? If you can confirm I think there may be an error in the Craft display of models. Some of my vertex shaded models are fine in modelling packages but distort in Craft. Something I have raised before.

  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G Im not seeing any type of distortion on level 4 or 5 when switching back and forth between the texture or lines. What I think you might be seeing on the texture is the reverse image. The front of the sphere is clear and you’re seeing the inside of the back of the sphere. Does the sphere rotate in the opposite direction that you’re sliding your finger to rotate it.

  • Posts: 2,277

    @dave1707 - you could be right, but why should you see that effect if you are not moving the camera position? Also it is occurring after re-texturing - doesn’t make sense.

  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G I have my ico settings different than what I posted. I set them to what I posted. When I switch between texture, lines, and back to texture, I see what I describe above. That’s caused by the line of code in drawlines(), s.material.blendMode=NORMAL. I had to add that line so the texture disappears when I draw the lines. When you switch back to texture, the outside of the texture is still clear and you’re seeing the inside of the back of the sphere. Not sure why the outside is clear but the inside isn’t.

  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G To fix the reverse texture problem when going from lines back to texture, change the line

        s1=icoSphere(vec3(0,0,0),100,level,false,true,1,image)
    to
        s1=icoSphere(vec3(0,0,0),100,level,false,false,1,image)
    

    Instead of setting the “inside” parameter to true, set it to false.

  • dave1707dave1707 Mod
    Posts: 9,295

    After further investigation, the triangles stop drawing when the count reaches 32,768 which is hex 8000. That seems like a likely number to stop at.

  • dave1707dave1707 Mod
    Posts: 9,295

    Verified. I modified my version of the code and added another slider. That slider draws triangles starting at 32,767 instead of 1. At the level 5 icosphere, when I flip the slider back and forth between false and true, I can see the triangles being displayed for the first part of the sphere and then the remaining part of the sphere.

  • edited June 18 Posts: 2,277
    @dave1707 - thanks for the update. Working fine with changes above. At 32,767 you might think that is a reasonably high number - but if you are drawing a scene that could be prohibitive. Although - is that number the limit for just one object. Could you display several high vertices spheres, textured at the highest level.

    Just changes the s1 definition to:

    ~~~
    s1=icoSphere(vec3(0,0,0),100,level,false,lines,1,image)
    ~~~

    Working with objects with complex surface detail could be a problem though.
  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G Modified my code to draw 2 icospheres with lines. Depending on the level of each icosphere, I could get both to draw all lines or 1 to draw all lines and the second only partial lines, or one to draw partial and the second none. So the limit isn’t by each icosphere, but the total scene.

  • edited June 18 Posts: 2,277
    @dave1707 - here’s what I managed with your demo. Added three spheres, switching to lines makes third sphere disappear and central sphere has lines + texture present. Probably needs a little more definition but limit in vertices is restrictive.
  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G The drawLines routine was originally written for 1 icosphere, so I’m not sure what sphere or combination it’s using since you’re drawing 3. The sphere that’s disappearing is the one where the lines should be drawn at, but they’re at the middle one. The above code shouldn’t be used for more than 1 icosphere unless it’s totally rewritten.

  • Posts: 2,277
    @dave1707 - thanks, kinda figured each sphere needed it's own complete environment . My main aim was to see if there spheres would display. I'll tidy it up but I suspect the vertices limitation would still cause an issue.

    Having said that the planet terrain demo for Craft does look quite complicated an may exceed the vertices limit. So there could be a way round the limitation. I'll take another look at that (before the footy starts).
  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G I don’t think the limit is for the vertices but for the debug:lines. I think that has the 32,768 limit. The Planet 3D looks complicated, but it’s not. The planet is just a level 1 to level 5 icosphere based on a slider that’s distorted. The other things are simple objects placed around the planet.

  • edited June 18 Posts: 2,277

    @dave1707 - thanks for the feedback.

  • dave1707dave1707 Mod
    Posts: 9,295

    @Bri_G The more I play with this, the weirder it gets. Here are 5 icospheres. Move the “lines” slider to show the lines. Not all of the lines are shown which I expect because there’s more than 32,768 lines. But here’s where the odd stuff starts to happen. Move the “slow” slider so it starts to draw the lines for each of the icospheres slowly. Everything goes OK until the running total reaches 32,768. After that, as the lines of the left icospheres are being drawn, the lines of the right icosphere are now un-drawing. That will continue until all the lines of the left icospheres are drawn. After that the count keeps increasing for the rightmost icosphere, but since we’re above 32,768 nothing is drawn anymore. Not sure about the un-drawing.

    viewer.mode=STANDARD
    
    function setup() 
        font("Courier") 
        parameter.watch("fps")
        textMode(CORNER)
        totalLines=0
        fill(255)
        parameter.boolean("lines",false)
        parameter.boolean("slow",false)
        sTab={}
        assert(OrbitViewer, "Please include Cameras as a dependency")        
        assert(icoSphere, "Please include IcoCreate as a dependency")            
        scene = craft.scene()
        scene.ambientColor=color(255)
        v=scene.camera:add(OrbitViewer, vec3(0,0,0), 150, 0, 3000)
        v.ry=180  
        image=readImage(asset.builtin.Surfaces.Basic_Bricks_AO)
        table.insert(sTab,icoSphere(vec3(-50,0,0),10,4,false,false,1,image))
        table.insert(sTab,icoSphere(vec3(-25,0,0),10,4,false,false,1,image))
        table.insert(sTab,icoSphere(vec3(0,0,0),10,3,false,false,1,image))
        table.insert(sTab,icoSphere(vec3(25,0,0),10,1,false,false,1,image))
        table.insert(sTab,icoSphere(vec3(50,0,0),10,5,false,false,1,image))
        tl=true
        for a,b in pairs(sTab) do
            totalLines=totalLines+#b.model.indices
        end
    end
    
    function draw()
        fps=1//DeltaTime
        update(DeltaTime)
        scene:draw()
        tl=0
        for a,b in pairs(sTab) do
            if lines then
                b.material.opacity=0
                drawLines(b)
            else
                b.material.opacity=1
                b.nbr=0
            end
            str=string.format("Level  %2d  %8d   %8d",b.level,#b.model.positions,b.nbr)
            text(str,100,HEIGHT-a*40-50) 
            tl=tl+b.nbr
        end
        str=string.format("Total    %10d %10d",totalLines,tl)
        text(str,100,HEIGHT-20)
    end
    
    function update(dt)
        scene:update(dt)
        for a,b in pairs(sTab) do
            b.rotation = quat.eulerAngles(-90,0,0)
        end
    end
    
    function drawLines(s)
        s.material.blendMode=NORMAL
        local sd=scene.debug
        local pTab=s.model.positions
        local iTab=s.model.indices
        if not slow then
            for z=1,#s.model.indices,3 do
                local p1=pTab[iTab[z]]+s.position
                local p2=pTab[iTab[z+1]]+s.position
                local p3=pTab[iTab[z+2]]+s.position
                sd:line(p1,p2,color(255))
                sd:line(p1,p3,color(255))
                sd:line(p2,p3,color(255))
            end
        else
            if s.nbr<=#s.model.indices-3 then
                s.nbr=s.nbr+3
            end
            for z=1,s.nbr,3 do
                local p1=pTab[iTab[z]]+s.position
                local p2=pTab[iTab[z+1]]+s.position
                local p3=pTab[iTab[z+2]]+s.position
                sd:line(p1,p2,color(255))
                sd:line(p1,p3,color(255))
                sd:line(p2,p3,color(255))
            end
        end
    end
    
    function icoSphere(pos,size,level,flat,inside,material,image)
        local s=scene:entity()
        s.position=pos
        s.model=craft.model.icosphere(size,level,flat)  -- create icosphere
        if material==1 or material>3 or material==nil then
            s.material=craft.material(asset.builtin.Materials.Basic) 
        elseif material==2 then
            s.material=craft.material(asset.builtin.Materials.Standard) 
        else
            s.material=craft.material(asset.builtin.Materials.Specular) 
        end  
        if image~=nil then 
            icoTexture(s,inside,image)
        else
            for z=1,#s.model.colors do
                s.model:color(z,color(math.random(255),math.random(255),math.random(255)))
            end
        end
        s.nbr=0
        s.level=level
        return s
    end
    
    function icoTexture(sph,inside,img)
        local seam=0
        local ax,bx,cx,ay,by,cy,c,lat,lon  
        local posTab={}
        local pTab,cTab,nTab,llTab,uvTab,colTab,norTab,iTab={},{},{},{},{},{},{},{}
        local deg=math.deg
        local asin=math.asin
        local atan2=math.atan2
        sph.material.map=img 
    
        -- create tables for rounded icospheres        
        if not flat then
            iTab=sph.model.indices
            pTab=sph.model.positions
            cTab=sph.model.colors
            nTab=sph.model.normals  
            for a,b in pairs(iTab) do
                posTab[a]=pTab[b]
                colTab[a]=cTab[b]
                norTab[a]=nTab[b]
                iTab[a]=a
            end
        end 
    
        -- convert sphere positions to latitude and longitude
        for a,b in pairs(posTab) do
            c=b:normalize()
            lat=deg(asin(c.z))+90
            lon=deg(atan2(c.y,c.x))
            llTab[a]=vec2(lon,lat)      -- save lon, lat in table
            if lon//1==-149 then        -- get exact value of seam
                seam=lon
            end
        end 
    
        -- shift points on the left side of the seam to the right side 
        for a,b in pairs(llTab) do        
            b.x=b.x-seam
            if b.x<-.01 then
                b.x=b.x+360
            end
        end 
    
        -- shift individual points of triangle if needed  
        for z=1,#llTab,3 do
            ax,ay=llTab[z].x,llTab[z].y
            bx,by=llTab[z+1].x,llTab[z+1].y
            cx,cy=llTab[z+2].x,llTab[z+2].y
            if ax>250 or bx>250 or cx>250 then
                if ax<.01 then 
                    ax=360
                end
                if bx<.01 then
                    bx=360
                end
                if cx<.01 then
                    cx=360
                end  
            end  
            if ay==0 or ay==180 then
                ax=(bx+cx)*.5
            elseif by==0 or by==180 then
                bx=(ax+cx)*.5
            elseif cy==0 or cy==180 then
                cx=(ax+bx)*.5
            end  
    
            -- create uv table
            uvTab[z]=vec2(ax/360,ay/180)
            uvTab[z+1]=vec2(bx/360,by/180)
            uvTab[z+2]=vec2(cx/360,cy/180)
        end 
    
        -- reset tables 
        sph.model.uvs=uvTab
    
        -- flat shows the triangles that make the sphere
        if not flat then
            sph.model.indices=iTab
            sph.model.positions=posTab
            sph.model.colors=colTab
            sph.model.normals=norTab
        end
    
        --update indices table for inside view    
        if inside then
            iTab=sph.model.indices
            for z=#sph.model.indices,1,-1 do
                iTab[#iTab+1]=iTab[z]
            end
            sph.model.indices=iTab
        end
    end
    
  • edited June 20 Posts: 2,277
    @dave1707 - sounds like it's wrapping round allocated memory. Off at the top on at the bottom, once the allocated memory is full. Not run it yet will check out soon.

    Edit: ran it and I see what you mean. I think@Simeon and @John need to look at this, hopefully not a problem in version 4.
Sign In or Register to comment.