RealityKit AR Directions - swift

Is it possible to make like an AR GPS type thing using RealityKit? Kind of like the lines that appear on the road in Watch Dogs.
I’m having an issue figuring out how to place objects in the correct direction. For example, I’m trying to make a line that goes straight towards the north pole, so you’d have to point your camera in that direction on the ground to see the line. Is this possible? My entity is always placed wherever the camera is pointed at. How do I place it in a predetermined position?

I learned a lot about that kind of thing from working through these examples on GitHub:
https://github.com/vasile/ARKit-CompassRose
https://github.com/ProjectDent/ARKit-CoreLocation
Neither is very recent, but all the concepts are there.

Related

how do i make a 3d character move in unity with WASD?

I am new to Unity, and I want to make a 3d character movement. Please help me. I have tried tutorials, but they don't work.
You first have to choose what kind of movement you want to accomplish i.e: 1st person, 3rd person etc. And saying that YouTube tutorials don't work definitely means you are missing something. Here are some good tutorials for different 3d movement. Please follow them thoroughly.
1st Person:
https://www.youtube.com/watch?v=_QajrabyTJc
https://www.youtube.com/watch?v=XAC8U9-dTZU
3rd Person:
https://www.youtube.com/watch?v=4HpC--2iowE
You can find a ton more movement systems on Google.
Your movement depends on your usage. You have to use a different approach if you want it to be Character Controller based than Rigidbody based. So learn the basics, and then experiment on your own until you are happy with it.
There are tons of ways to make a player move in 3D, and there are just as many tutorials that explain it. If you need a place to start, see the character controller component.
If you have a 3d model of the character, just add this component and it will start moving right away.
the gameobject does not have to have rigidbody or collider components, because it takes care of the whole character controller.
If I gave you a hand to get started, you can mark my answer as accepted, and vote it positively :)

How to get the distance from daydream controller to a pointed game object in unity?

Following the google-vr sample I manage to add a camera and controller to my scene.
The next thing I need is to get the distance between my controller to any pointed game object in the scene.
After searching for a while, I cannot find any tutorial nor information on how to get the distance.
So, is there any newest working tutorial on how to do this? (Many tutorial on the internet is outdated since google updates its API so frequently)
Or it is actually a simple task i.e. I can get the value from GvrPointerInputModule.Pointer / GvrLaserPointer / some other GVR class?
Thanks in advance~
You need to do raycasts from the controller and measure the difference between the hit location and the origin of the Ray cast. I think unity raycasts can return this distance built-in.
Just as I suspected, GvrLaserPointer is the answer.
If its CurrentRaycastResult.gameObject is not null, then the laser is intersecting with something. Then, we can get the intersection point from CurrentRaycastResult.worldPosition.
Using this point, we can easily calculate the distance.
Note: Just in case anyone failing with this method, like I did before. Check your ray casting group. Make sure that your Raycaster Event Mask in GVRPointerPhysicsRaycaster only include the desired layers. And if you have any canvas in screen space, check its Blocking Mask in Graphic Raycaster. It's Everything by default and your pointer may keep intersecting with the canvas, resulting in "weird" intersection point. This the cause of my problem, and to fix it, I select Nothing for Blocking Mask, and voila.

Identifying boundaries and objects in real time (tango)

Is there a possibility with a google tango camera to create a situation, that my player goes on the table and if he comes out of the table he falls? Has anyone ever done anything similar and has references or ideas on how to do it?
in order to implement the functionality that you described, you will need to find different planes from the real world and translate their position into Unity scene. There is a class in Tango SDK, called TangoPointCloud which contains several methods for recognizing planes and translate their position into unity scene points. By knowing the positions of the table and the floor, you might be able to implement the feature you want. In my case, TangoPointCloud helped me find the walls from a room and their position relative to unity scene units.

Iphone OpengGL ES: detecting clicks on a primitive

I have created a 3d environment full of 3D cubes, does anyone have any idea how you would detect a touch on one of these Cubes. I thinking if I could get the cubes screen position (coords start from bottom left) then it would be pretty easy
UPDATE:
I added the function -(CGPoint)getScreenCoorOfPoint:(IMPoint3D)_point3D which seems to give me my items position in the world but the bit I am now stuck on is:
I have objects that have a position
I have my position in the world (gluLookAt eye[0], eye[1], eye[2])
and then I have where I tapped on the screen
How do I join all this up, its the last thing in my way to archiving greatness!!!!
Look up OpenGL picking on Google. There are two main methods to accomplish this, I recommend you use the second one described at OpenGL.org as it does not involve rendering anything offscreen:
[…] involves shooting a pick ray through the mouse location and testing for intersections with the currently displayed objects. OpenGL doesn't test for ray intersections, but you'll need to interact with OpenGL to generate the pick ray.
Also see this question for some discussion on the matter:
Screen-to-World coordinate conversion in OpenGLES an easy task?

Problem in using CCCamera

I am going to work on a game project. I am using cocos2d. I want to use cccamera class of cocos2d. Please tell me about any tutorial on cccamera. I want to implement more or less like angry birds, throwing the ball that reaches its destination facing the obstacles in the way.
So when the ball moves ahead the scene accordingly moves back depending on speed of the ball.
How to manage all that. I think i should use cccamera.
Thanx.
CCCamera, per the documentation is used for 3D effects (http://www.cocos2d-iphone.org/api-ref/latest-stable/interface_c_c_camera.html) and recommends the use of CCFollow (http://www.cocos2d-iphone.org/api-ref/latest-stable/interface_c_c_follow.html) for 2D related effects (such as following the birds forward, etc).