Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - rkull

Pages: [1]
1
Support / Render a plane seen from the side as line?
« on: November 11, 2020, 12:49:17 pm »
My first post here! :)

Have been googling around alot looking for answers to this but no success yet. Maybe someone here have done something similar.

My problem:
I'm visualizing a vehicle moving around on a surface. In the app, I have added the possibility to split the view into smaller parts with other camera positions. Currently, the user can select to view the scene in 1-4 different views; 3d (where camera can be zoomed and rotated around vehicle), top (vehicle seen from above, only zoomable), side (only zooming) and rear (only zooming).
The problem I'm facing is when using the side and rear views. At some viewing angles, and depending on the surface (which is not flat), the surface will disappear (since the mesh has no thickness, I know this is how it works).

Wanted behavior:
When using the side and rear views, I would like to visualize the surface as a line below the vehicle, like a 2d scene. So, do anyone have any tips of how I can solve this? I've been trying some custom shaders but no luck (but I'm defenently no shader-expert ;)) Also, polyline seems to be out of the question since I would have to calculate the line coordinates which is too heavy for my hw.

In the desktop version, the drawWireframe(...) solves the problem for me if I set the near/far planes at the same distance (cam - vehicle distance). But the desktop drawWireframe() and Android drawWireframe() doesn't give the same results. Read somewhere that this was because of OpenGl ES but I don't know what in OpenGl ES that causes the problem..

Hope you guys understand my problem and what I'm trying to do!
I know this is not particularly a jpct question but more of a general opengl topic. But since I'm using jpct in my project, I thought this would be a good place to ask some questions :)

Pages: [1]