@binaryblues @John Same here.
Thank @binaryblues @se24vad this will will be fixed in the next release.
@GR00G0 Craft does not support smooth terrain at this time (as a feature). You can generate terrain using mesh and noise functions though. See the Planet Generation example (make sure to reset examples) for some of the ground work.
I have 2 questions:
-
How to import Model files( obj + mtl )? I have seen the example of load models, but these model files were already in Codea, I wish to use my own model files.
-
How to create a skybox? Wish to provide an example.
Who know the solution? thanks!
@Simeon @John Running the latest version of the Codea Beta, it deleted 25 of my projects and everything in my Dropbox folder. I figured I’d just sync the Codea Dropbox folder with the Dropbox app folder to get the Codea Dropbox folder back. Wrong. Since the files in the Codea Dropbox folder were deleted, the files in the Dropbox app folder were deleted when synced. No big deal there because I also have the Dropbox app files copied in a Dropbox app backup folder. Another good thing I did was a Codea export a while back. I had to drop the Codea Beta back to the previous Codea regular version and update it to the version that allowed the import. I was able to import my deleted projects, but when I tried to import the files in the Dropbox folder, it said the folder already existed and wanted me to enter another name. So is there a problem there. Can the Codea Dropbox folder be deleted and a new one restored, or should it have just restored the exported files into the existing Dropbox folder. Getting back to the original problem, I don’t know why Codea deleted all that stuff. I was playing around with creating a project in a collection when I noticed my missing projects. I know they were there before I started. I wasn’t doing anything with deleteProject, so that wasn’t involved. The projects that were deleted began with a . (period) or a number, and I don’t know why the Dropbox folder was affected. I also haven’t looked thru all of my projects to see if anything else was deleted. I’ll eventually get everything back so it’s no big deal. I wonder if this could be related to the deleted tab problem.
Does anyone know what I am doing wrong with custom meshes? Even when I copy all detail from a icosphere or cube it just dooesn’t render anything?
It’s hard to say what you’re doing wrong if we can’t see what you’re doing. Post an example. Maybe one reason it’s not working is because Craft isn’t complete yet.
Here’s what I did:
e = scene:entity()
m = craft.mesh()
cube = craft.mesh.cube(vec3(1,1,1))
m:resize(cube.vertexCount)
m:resizeIndicies(cube.indexCount)
for i=0, cube.vertexCount-1 do
local pos = vec3(cube:position(i))
m:position(i, pos )
end
for i=0, cube.indexCount-1 do
m:index(i,cube:index(i))
end
for i=0,cube.vertexCount-1 do
local n = vec3(cube:normal(i))
m:normal(i,n)
m:color(i,color(cube:color(i)))
m:uv(i,vec2(cube:uv(i)))
end
local renderer = e:add(craft.renderer,m)
renderer.material = craft.material("Materials:Standard")
renderer.material.map = readImage("Blocks:Brick Red")
e.position = vec3(0,0,0)
craft.scene.camera.rotation = quat.eulerAngles(0,180,0)
craft.scene.camera.position = vec3(0,0,-10)
@GR00G0 I’m not exactly sure of everything your trying to do, but here’s some code I have. I added the Blocks:Brick Red map you show to my code. You can compare this to what you’re trying to do.
function setup()
parameter.integer("x",-180,180,45)
parameter.integer("y",-180,180,30)
parameter.integer("z",-180,180,60)
scene=craft.scene()
cube=scene:entity()
cube.z=10
r=cube:add(craft.renderer,craft.mesh.cube(vec3(1,1,1)))
r.material=craft.material("Materials:Standard")
r.material.map = readImage("Blocks:Brick Red")
r.material.diffuse=color(255,0,0)
end
function update(d)
cube.rotation = quat.eulerAngles(x,y,z)
end
function draw()
update(DeltaTime)
scene:draw()
end
@dave1707 That’s the point. Creating the mesh with the craft.mesh.cube function works for me. But try to make a simple cube using an empty mesh. Please send me your results if you get any.
@GR00G0 I don’t understand what you mean by using an empty mesh. What are you trying to accomplish with the empty mesh. I haven’t played around with Craft that much because there’s not enough documentation and it’s still not complete.
@dave1707 I mean If I want a dirfferent mesh from a cube or a icosphere. I mean that you create an empty mesh and add detail to it.
@GR00G0 Here’s basically an empty mesh with a red circle in the middle. If you tap the screen, I add green dots. Is that what you mean by create an empty mesh and add detail to it.
function setup()
img=image(300,300)
setContext(img)
background(255)
fill(255)
ellipse(150,150,100)
fill(255,0,0)
ellipse(150,150,50)
setContext()
parameter.integer("x",-180,180,45)
parameter.integer("y",-180,180,30)
parameter.integer("z",-180,180,60)
scene=craft.scene()
cube=scene:entity()
cube.z=10
r=cube:add(craft.renderer,craft.mesh.cube(vec3(1,1,1)))
r.material=craft.material("Materials:Standard")
r.material.map = img
end
function update(d)
cube.rotation = quat.eulerAngles(x,y,z)
end
function draw()
update(DeltaTime)
scene:draw()
end
function touched(t)
if t.state==BEGAN then
setContext(img)
fill(0,255,0)
ellipse(math.random(300),math.random(300),20)
setContext()
end
end
@dave1707 No I mean for a given entity create a new mesh first with craft.mesh() and then add positions, uv’s etc. to t with mesh:position()/uv() etc.
@GR00G0 Like I said above, I haven’t played with Craft that much so I don’t think I can help you. I’ll have to go back and look at the code you posted and see what you’re trying to do there. Maybe that will help me understand more.
@Simeon @John I don’t know if this has anything to do with Craft code being added, but here’s 2 images showing 2 regular physics runs. The first one shows a smooth movement and the other one with a lot of gaps. If a larger object was being displayed on the second run, it would show a really bad jerky movement. I used the below code to create the images. I used backingMode to capture each draw cycle to show the gaps. You might have to restart the code several times before you get a jerky run. This was run on an iPad Air.
EDIT: The first image shows only 2 gaps in the run where the second image is filled with gaps.
displayMode(FULLSCREEN)
function setup()
physics.gravity(0,0)
physics.continuous=true
physics.interpolate=true
el=physics.body(EDGE,vec2(0,0),vec2(0,HEIGHT))
er=physics.body(EDGE,vec2(WIDTH,0),vec2(WIDTH,HEIGHT))
et=physics.body(EDGE,vec2(0,HEIGHT),vec2(WIDTH,HEIGHT))
eb=physics.body(EDGE,vec2(0,0),vec2(WIDTH,0))
b=physics.body(CIRCLE,4)
b.x=WIDTH/2
b.y=HEIGHT/2
b.restitution=1
b.friction=0
b.linearVelocity=vec2(200,400)
backingMode(RETAINED)
end
function draw()
fill(255)
ellipse(b.x,b.y,8)
end
@dave1707 That doesn’t seem right, I’ll have to test that.
Wow
fantastic-the dog is incredibly life like!