Howdy,
The perf is pretty good. The only thing I have is still the same as with question above – my *.fill = {type=“camera”} is in enterFrame(), where I think it shouldn’t be.
anyway, the kit is here: https://github.com/jyrkih/arkit-corona, sample is main.lua file basically.
If you look at it, it’s pretty simple:
-- require module local ar = require("arkit.arkit") print(ar.deviceSupportsAR()) local isSimulator = system.getInfo("environment")=="simulator" -- setup POI array local pointsOfInterest = { {longitude = -73.994901,latitude = 41.145495,altitude = 30, title="New York"}, {longitude = 24.9354500,latitude = 60.1695200,altitude = 30, title="Helsinki"}, {longitude = 33.0788,latitude = 68.969,altitude = 30, title="Murmansk"}, {longitude = -3.696111,latitude = 40.416667,altitude = 30, title="Madrid"}, } local ds = display.getCurrentStage() local delegate = {} local \_locations=nil local \_userLocation = nil local controller = nil -- this function show the marker local function setMarkerView(coord) coord.displayView = display.newGroup() coord.displayView.anchorChildren = true coord.displayView.x = 0 coord.displayView.y = 0 local c = display.newCircle(coord.displayView, 0, 0, 20) c:setFillColor(1,0,0,0.5) local opts = { text = coord.title, parent = coord.displayView, x = 0, y = 30, --required for multi-line and alignment font = native.systemFont, fontSize = 18 } display.newText(opts) end -- register points of interest to the AR controller local function setupLocations() \_locations = {} for i=1, #pointsOfInterest do local poi = pointsOfInterest[i] local c1 = ar.argeocoordinate:coordinateWithLocation(poi, poi.title) c1:calibrateUsingOrigin(\_userLocation) setMarkerView(c1) controller:addCoordinate(c1) \_locations[#\_locations+1] = c1 end end -- callback for location events function delegate:location(event) local init = false if not \_userLocation then init = true end \_userLocation = event if init then pcall(self.geoLocations) end --print("delegate.location()", event.longitude, event.latitude, event.altitude) end --callback for heading event function delegate:heading(event) --print("delegate.heading()", event) end --callback for orientation event function delegate:orientation(event) --print("delegate.orientation()", event.type) end --accessor function delegate:geoLocations() if \_locations == nil then setupLocations() end return \_locations end -- ar controller setup, given delegate object as callback controller = ar.arcontroller:new(ds, delegate) -- configuration here controller.radarRange = 3000 controller:setShowsRadar(true) controller.onlyShowItemsWithinRadarRange = true
You can also check objective-C ARKit fork:
https://github.com/nielswh/iPhone-AR-Toolkit
and especially
https://github.com/chrjs/iPhone-AR-Toolkit
for reference. I’m still to complete most configuration options for controller, so it’s WIP.
Jyrki