Dropboxing 3D objects

@pac - you can move files around with the Apple File app. I also use File Explorer Pro. I find it to be very messy - that is to move/transfer/copy on the iPad, seems to be a few different ways which can be confusing.

Thanks @Bri_G I will try that out.

Okay do you guys use sketch 3D?

If you do could you tell me how to bet the colors to come out right. My colors come out all messed up.

Please help if you can.

@pac - installed but found it hard to use.

I tried sketch 3D and found it hard to use also. It’s not very intuitive and takes a long time to figure out how to do simple things. I played with it for a couple of days and gave up on it.

That’s okay because I have decided that I am going to make a blocky game. And I think the best way to build to stuff I need to build would be to use the volex editor in codea but I don’t know how to get the volex format to load into my program. If you could show me that would be very helpful.

Thanks @Pac

@pac I assume you mean the Voxel editor. With the editor running, if you tap the > in the upper left corner you get more options. There’s a load and save option that saves a file in Documents with a cvox extension. If you write your own code, you can read that file using the Voxel commands. I’ve never tried that so I can’t help now.

Okay thanks @dave1707 but I have already tried to get that to work and I don’t know how to get it to load and the Volex’s code is so complicated.

@pac The Voxel code is complicated, but like everything else, the more you use it the easier it gets. If you’re after a block type game, here’s some simple code to make a block type object and move it around. Just add more blocks to create what you want.

displayMode(FULLSCREEN)

function setup()
    assert(craft, "Please include Craft as a dependency")
    assert(OrbitViewer, "Please include Cameras (not Camera) as a dependency")
    scene = craft.scene()
    skyMaterial=scene.sky.material
    skyMaterial.sky=color(0, 62, 255, 255)
    skyMaterial.horizon=color(204, 223, 138, 255)
            
    scene.sun.rotation=quat.eulerAngles(0,0,-30)
    viewer = scene.camera:add(OrbitViewer, vec3(0,0,0), 20, 0, 600)
    
    tab={}
    table.insert(tab,create(0,0,0))
    table.insert(tab,create(1,0,0))
    table.insert(tab,create(2,0,0))
    table.insert(tab,create(1,1,0))
    table.insert(tab,create(1,-1,0))
end

function update(dt)
    scene:update(dt)
end

function draw()
    update(DeltaTime)
    scene:draw()	
    for z=1,#tab do
        tab[z].position=tab[z].position+vec3(.01,.01,.01)
    end
end

function create(x,y,z)
    local b=scene:entity()
    b.position=vec3(x,y,z)
    b.model=craft.model.cube(vec3(1,1,1))
    b.material=craft.material("Materials:Standard")
    b.material.map ="Blocks:Glass Frame"
    return b
end

@pac Here’s something to use when you create something in the Voxel editor. Create something using the Voxel editor then save it. To save it, tap the > in the upper left corner of the screen. Key in a name and press Save. It will be saved in the Documents folder, but you won’t be able to see the name there, so write done the name you use. Then use this code to Load it. You can use this code in whatever code you write. Use the parameter sliders to move the object here.

function setup()
    assert(craft, "Please include Craft as a dependency")
    assert(OrbitViewer, "Please include Cameras (not Camera) as a dependency")
    
    parameter.text("Filename", 
        function(t) 
            saveProjectData("filename", Filename) 
        end)
        
    parameter.action("Load", 
        function()
            volume:load("Documents:"..Filename)
            sx,sy,sz=volume:size()
            viewer.target = vec3(sx/2, 0, 0)
        end)
    
    parameter.integer("vx",-10,10,0)
    parameter.integer("vy",-10,10,0)
    parameter.integer("vz",-60,60,0)
    
    scene = craft.scene()
    scene.ambientColor = color(77, 77, 77, 255)
    scene.sun.rotation = quat.eulerAngles(25, 125, 0) 
    
    volumeEntity = scene:entity()
    volume = volumeEntity:add(craft.volume, 0,0,0)
   
    viewer = scene.camera:add(OrbitViewer, vec3(0,0,0), 50, 0, 100)
end

function update(dt) 
    scene:update(dt)
    volumeEntity.x=vx
    volumeEntity.y=vy
    volumeEntity.z=vz
end

function draw()
    update(DeltaTime)   
    scene:draw()
end

@dave1707, @Simeon - just tried to run VoxelEditor on my system and it came up with an error in the editor. Pic attached. Cameras included as dependency.

Edit: similar error with Voxel Terrain and Voxel Player.

@Bri_G Try checking UI, Touches, Block Library, and Cameras as dependencies and see if that works. I’m on the latest version and not having trouble with just Block Library checked for the Voxel editor. The other ones need more things checked.

Thanks Dave you are a game saver.

Thanks

Okay Dave in the program were it loads in the info from the volex editor you may want to change your code you have it looking for it in the dropbox file but I saw it so thank-you for writing your comment correctly.

Thanks @dave1707

@pac Thanks for noticing that, I thought I changed it. I had Dropbox in both my code and the Voxel Editor because you can’t see/delete it from the Documents folder. At least when I use the Codea Dropbox folder and sync it with the Dropbox app, I can see and delete it in Dropbox which will delete it from the Codea Dropbox folder when I do a sync.

@Simeon Are changes ever going to be made so we can see every file in the Documents and Dropbox folders.

@dave1707 the plan is to remove the Dropbox folder and instead allow files to be referenced or copied from anywhere using the document picker

But you’re right that we should just show all file types when viewing assets. I’ll look into that soon.

@dave1707 - no, sorry but it doesn’t work on my iPad Pro, latest iOS and 2.6.3 (136). Most of the dependencies were already set, I set UI. But I noticed in Voxel Editor there is a UI tab and a ‘ui’ class. Could there be a clash there?

Okay @dave1707 one more thing is that I need to have custom textures for the blocks so do you know how to make it so I can change the textures.

Thanks

If you can’t don’t worry about it.

@Bri_G Have you tried pressing “Restore All Examples” and see if that helps. If that doesn’t work for you, let me know and I’ll load the latest code on my iPad Pro and try it.

@pac At this point I don’t know, but I’ll look into it.