Place one instance of model in ARCore Sceneform - arcore

Having completed the Sceneform quickstart, I'm still having trouble implementing my model placement method...
Rather than each touch of the screen placing a new instance of the model (as in the quickstart & codelab), I'm trying to have each touch reposition the model to that location while still retaining the drag & scale interation.
Any ideas?

...
Hi Mark,
you can try to save a reference to node that you have created previously at your first touch. I mean the TransformableNode that is used into the codelab.
When you touch on another point:
1- Detach that node from it's current parent.
2- Attach the node to the new Anchor you have just created on the hit.
Hope this help.
Cheers

Related

What does Xcode 11.3.1's scene kit editor "Velocity Field" (SKVelocityFieldNode) do?

I'm trying to add some velocity to an object in Xcode's scene editor. I looked in the Objects Library and saw "Velocity Field" which creates what it calls SKVelocityFieldNode. There's no documentation at all on SKVelocityFieldNode? Google can't find anything. Anyone know whether this can be used to apply a velocity to an SKNode?
It’s what you get when you create a velocity field.
https://developer.apple.com/documentation/spritekit/skfieldnode/1519778-velocityfield

iPhone-AR toolkit - Does not update points on the radar when device starts moving

I have implemented the iPhone-AR toolkit app found in this link.
https://github.com/a1phanumeric/iPhone-AR-Toolkit
I want to re plot the radar points everytime device starts moving i.e. Everytime the current lat long values change, the existing set of values should change their position on the radar . But it does not move the points present on the radar. Can anyone tell me where I have to change to implement this?
You can try Calonso's ar-kit project which is similar to yours since they are both forked from same repository: https://github.com/calonso/ios-arkit

OpenLayers3 - is it possible to combine modify/draw/select operations?

I've started using OpenLayers3 in my app, and so far, I have succeeded in creating working versions of:
a combined draw/modify page (based on the relevant example, draw-and-modify-features.js)
a combined select/modify page (based on the relevant example, modify-features.js)
In the case of (1), the ol.interaction.Modify instance specifies that it will work on the features inside an ol.FeatureOverlay instance:
var modify = new ol.interaction.Modify({
features: featureOverlay.getFeatures()
...
...and it is that ol.FeatureOverlay that holds all the new features drawn by the user.
In the case of (2), the ol.interaction.Modify instance specifies that it will work on the features inside the ol.interaction.Select instance:
var select = new ol.interaction.Select();
var modify = new ol.interaction.Modify({
features: select.getFeatures()
});
...and unless I am mistaken, this creates a hidden ol.FeatureOverlay that holds the currently selected feature - which is then edited.
However, I can't see a way to combine all 3 - i.e. a user-friendly way to allow a user to draw, select and modify polygons.
What I'd (ideally) want is the functionality of draw/modify, but the moment I hit and keep Ctrl pressed, the cursor is no longer working in "draw" mode, but in "select" mode, allowing me to select one of the existing polygons, and subsequently hiting Delete on the keyboard to delete it, or just edit its vertices with the mouse. As soon as I click outside all polygons, I return to draw/modify mode.
I did the naive test - that of adding an ol.interaction.Select to the interactions of the draw/modify Map instance - which lead to hilarious results :-) For example, upon finishing the drawing of a polygon (i.e. when I double-click to close it) it's also getting selected... and clicking anywhere (inside or outside polygons) just starts another new polygon edge, it never selects a pre-existing one - etc.
My only thought of a solution so far is... for me to implement a "VI emulation" :-) i.e. a "command" mode (that is, the select/modify state) and an "insert" mode (i.e. the draw/modify state) - and you chose what mode you are in from a "state toggle" button inside the map (custom OL3 control) or outside the map (normal HTML button) .
I am, however, looking for a better way, like the one I suggested with holding Ctrl...
Any ideas/suggestions most welcome.
I never found a solution combining all three modes. Since no answer came up, I might as well share that in the end, having a "modal" form of working (i.e. hitting a custom control - a map-internal button - to enter "Select Mode") is not that bad. I ended up with a "Select mode", a "Draw/Modify mode", and a "Measure" mode - selectable via map-internal buttons:
In the end, it turned out fine - in hindsight, having a "combo" mode would in fact present significant usability disadvantages.

Problems with .ccb file for sprite in SpriteBuilder

I am trying to understand SpriteBuilder. I made a new file hero.ccb for sprite and set it's sprite frame to the image I need. When I go back to the MainScene and drag hero.ccb from the left menu,there is just a CCBFile without anything(no sprite image). What am I doing wrong?
This can happen if you didn't save the hero.ccb. Choose File -> Save All or simply Publish the project to have SpriteBuilder update all references.

How to change the Content Node for a CCSrollView in SpriteBuilder

I'm building a game that requires levels. These levels, so that they all fit onto one page I have had to add them to a CCScrollView. This view loads automatically, as I have set in the SpriteBuilder App. The CCSrollView has been added in the MainScene.ccb file, and the content node for the scroll view is Level.ccb. What I'm trying do is have a button that is in the Level.ccb that changes the scene/content node to a level which is called Gameplay.ccb. I've tried writing the code to change the scene in the MainScene.m and Level.m files in Xcode. However these bring up an error. I'm still learning to code, so sorry if the question has been asked or has a really easy solution
- (void)levelOne {
CCScene *gameplayScene = [CCBReader loadAsScene:#"Gameplay"];
[[CCDirector sharedDirector] replaceScene:gameplayScene];
}
This piece of code is how i would switch the scene without the scrollview
If you do not understand what my problem is and would like the code send me a message and i will email you the source code
Thanks!

Resources