ARKit line between two SCNNode - arkit

it is possible to draw a line from an SCNNode to another and keep the line 'updated' when the user move around the device? In my scenario I have to ARImageAnchor and I would like to create a line between this two points.

I have a demo creating line between two node https://www.youtube.com/watch?v=YDUq7nfvXBc&feature=youtu.be if this is what u want u can comment below

Related

Is there a way to make a Line Renderer 3D in Unity?

So I was wondering how can I make a Line Renderer between to points (joints) be a 3d model or at least how can I make a separate 3D model to follow the movement of the line renderer.
I have an AR project where, for a finger there is two points calculating the width of the finger and then a Line renderer comes in as a "ring" for the finger. And i was wondering how can make it a real ring by adding a 3D model
As a mesh for such a "ring" would be called a "torus". Someone apparently made a neat script to generate those: https://www.devcoons.com/how-to-make-a-ring-using-torus-method-in-unity-3d/
Keep in mind that generating meshes is not super fast. So try to generate one at game start and scale in case you neeed it with different dimensions.
EDIT: This could be also interesting and more flexible: https://wiki.unity3d.com/index.php/TubeRenderer

How to create a SKPhysicsBody in a shape of a parabola?

I need to create a SKSpriteNode or a SKShapeNode such that it would look like the image below. I can figure out how to use a texture to get the shape of the line but I can't seem to find a way to make the physics body. It needs to be made out of two horizontal lines which can change their y position and the middle parabola-like shape joins the other two lines with a specified maximum point (the maximum would hopefully be a variable).
(Note:- the blue and green lines are just to highlight that the image is compromised of three objects)
Is this possible? Thanks!

Creating A Racing Line For an AI Path

I am currently creating a top down racing game ( or trying! ) using SpriteKit. I am creating tracks procedurally with catmullrom splines created from points. I have access to three sets of points, the inside of the track, the outside of the track and the centre line of the track.
I am using GKAgents, GKGoals, and GKBehaviours from GameplayKit for the AI cars, and I currently have a few cars following a GKPath. The points I have provided to GKPath are the centre line shown in yellow in the image.
My maths skills are not all that! So my question is given that I know the inner, outer and centre points, how can I modify my centre line points to create a more realistic racing line for the AI cars to follow?
If you need a clearer idea of what is going on, you can see the central points in a video: https://www.youtube.com/watch?v=yhwNL0iCBuU

Connecting two TShape objects

i'm trying to do simple game in lazarus, but i'm stuck with one thing that i don't really want to overcomplicate. I have some circles on the screen (pretty small ones, 10pixels diameter) and i want to draw lines between two selected. So i thought i gonna make invisible hitboxes. I took care that two hitboxes doesn't intersect.
And i want to do simple drag and drop. If i drag circle or it's hitbox and drop it on another circle or it's hitbox i want to draw a line between those two circles. And my question is: is there a elegant way of knowing which circle belongs to a hitbox? Or maybe some other nice solution to this problem?
I'm not sure how exactly you have your setup, so the answer is quite generic.
You can start with the following:
Have a function to detect which circle is below cursor - CircleHitTest(X,Y: Integer): Integer;. If there's no circle at given XY - return -1.
Upon MouseDown detect which circle was under a cursor and store it's Id in variable DrawFrom.
Upon MouseUp detect which circle was under a cursor and store it's Id in variable DrawTo
If DrawFrom and DrawTo are two different and valid circles - draw a line between them.

how to draw line with animation?

I have implemented game application in which i want to draw line between two object.I have drawn line between two objects.But i want to draw with animation.can u advise me which animation i have to used between two points.
Edit:My excatly question is that:
Suppose there is two point like start point(100,100) and endpoint(300,300).I can draw line between this two point but i want to draw line with animation.I mean i can see line start from start point to end point with 2 secon duration.please help me about this question.
+1 for Brad's answer—it'll work—but it looks like you can accomplish the same thing in a more straightforward fashion by animating the strokeStart and strokeEnd properties on CAPathLayer.
See http://oleb.net/blog/2010/12/animating-drawing-of-cgpath-with-cashapelayer/
If you're looking to animate the extension of a line from point A to between points A and B, my recommendation would be to use a CAShapeLayer for this. CAShapeLayer lets you animate the interpolation between two paths with the same number of control points. For an example of this in action, see Joe Ricioppo's post on the subject.
In your case, you'd start with a path that has two control points, both the same point, and use as the final path one that has a control point at the start of the line and one at the end. The line will then animate out as if it were being drawn in a single brush stroke.