3d curve in codea?

i would like to be able make use of a ‘3D curve’ similar to that used in this very cool app

http://drawin3d.com

Given the points on the curve, would it be easy to implement such a 3D curve in Codea?
Perhaps within the framework of the @loopspace 3D shape library?

(By the way, this app allows to export the final 3D drawing as a .obj file)

I’m sure it’s possible, but it will take some work and experience in 3D. Have you done any 3D work so far?

Take a look at the Roller Coaster demo. The track is almost what you want, only it isn’t made into a solid cylinder but rather some other shape.

Although that doesn’t use the 3D shape library, it inspired it and it wouldn’t be difficult to adapt the concept into using the shape library.

ok, i will take look at the roller coaster demo.

i made a first attempt using cylinders as the segments and using spheres to fill in the joints.
But for reasons i don’t understand the spheres do not get displayed?

-- 3d pipe
--
displayMode(FULLSCREEN)
function setup()
    --define direction of light source - this is the direction light is coming from, 
    --ie if you draw a line from here to 0,0,0, that is the direction of the light
    light=vec3(1,.5,0)
    --create shapes using colours and images
    --we'll store them in separate meshes, because these shapes will usually be moved/rotated individually
    shapes={}
    newcyl={}
    newsphere={}
    pts={}
end

function touched(t)
    tpos=vec2(t.x,t.y)
    if t.state==MOVING then
        print (tpos)       
        table.insert(pts,tpos)
        npts=#pts   
        if npts>1 then 
            dir=pts[npts]-pts[npts-1]
        else
            dir=vec2(0,0.1)    
        end
--       
        newcyl[npts]=addCylinder{
           centre=vec3(0,0,0), 
            height=dir:len(),
            radius=10,
           color=color(141, 203, 77, 255),
--             texture="Cargo Bot:Starry Background",       
            light=light,
            ambience=.5,
            faceted=false,
            axis=vec3(dir.x,dir.y,0)
            }
        newcyl[npts].pos=vec3(pts[npts].x, pts[npts].y, 0)   
        table.insert(shapes,newcyl[npts])   
--]]             
--[[   
        newsphere[npts]=addSphere{
            centre=vec3(0,0,0),
            size=10,
            color=color(141, 203, 77, 255),       
--            texture="Cargo Bot:Starry Background",
            light=light,
            ambience=.5} 
        newsphere[npts].pos=vec3(pts[npts].x, pts[npts].y, 0)   
        table.insert(shapes,newsphere[npts])
--]]        
    end                
end

function draw()
    background(50)
--    perspective()  --puts Codea in 3D mode
--    camera(0,0,250,WIDTH/2,HEIGHT/2,0) --camera is 250 pixels back from 0, looking at (0,0,0)
--        camera(0,0,250,0,0,0) --camera is 250 pixels back from 0, looking at (0,0,0)    
    for _,s in pairs(shapes) do
--        print("-")
        pushMatrix()
        translate(s.pos.x,s.pos.y,s.pos.z)
--        rotate(rot.x,1,0,0) rotate(rot.y,0,1,0) rotate(rot.z,0,0,1)
        --use this next line with all your objects that use lighting
        if s.shader then s.shader.invModel = modelMatrix():inverse():transpose() end
        s:draw()
        popMatrix()  
    end
end

Arent you drawing the spheres and cylinders in the same places, ie on top of each other?