popcron / gizmos

Used for drawing runtime gizmos in builds and editor (Unity3D)
MIT License
549 stars 43 forks source link

Lines rendering towards camera. #19

Closed Nahush22 closed 4 years ago

Nahush22 commented 4 years ago

I have attached 2 images below.In editor(image 1) the the lines drawn are perfectly placed on the planet orbits but in runtime(image 2) the lines faced towards the direction of the camera.How to fix it or make the lines stay static?Thanks in advance. img1 img2

Nahush22 commented 4 years ago

This is my script that I attached to the gameobjects for each planet that were present in the Sun's position. circlescript.txt

popcron commented 4 years ago

I dont think I understand what youre saying here: the lines faced towards the direction of the camera

Is the issue that the lines get clipped due to the far clip plane of the camera?

Nahush22 commented 4 years ago

Ohh I am sorry.Since I am new to Unity I dont know how to explain it properly. I am actually building an AR app using Unity which renders the solar system on top of an image target. If you see the images I included then you can see that in the editor mode I placed the circles that I created using the script on the orbits of the planets.But after I built it as an apk file & then installed & ran it on my Android phone, the circles arent in the planet orbits & seem to be displaced from them.You can see it in the second image.I think the 2nd image might be confusing since I made the planets to also orbit around the sun in runtime.The circles arent static & are moving along with the camera.Again extremely sorry if I didnt explain it properly.If you dont understand it then maybe I'll also take a video of what is happening in runtime & link it here.

Nahush22 commented 4 years ago

img3 Ok, I after a bit of research I tried changing the orientation of the camera(i set x value to 90 in rotation) in editor.So now the circles are rendered over the planet orbits in my phone camera as seen in the image above.But the problem now is that the lines/circles arent staying still & are constantly moving along with the orientation of my phone camera.Any fix or workaround for this?

popcron commented 4 years ago

So the lines are aligned to the phone camera?

Nahush22 commented 4 years ago

No,if you see the 3rd image then you can see that I fixed the lines being seemingly perpendicular to the camera view.But now the problem is that the lines arent stationary & they move whenever I move the phone camera.

popcron commented 4 years ago

Yeah i dont think im getting at what youre trying to say, do you have a video to show? And is this even related to the code in the gizmos package or something to do with the AR setup?

popcron commented 4 years ago

Closing due to inactivity and unclear details