need help in making a simple radar for game

Started by
4 comments, last by markshaw001 6 years, 6 months ago

hi i am new to opengl can someone here tell me how to render this 2d shape i want to make curve or arc in 2d in between two lines its a rough sketch i made i tried the internet but could not find much help beacuse their were no specific tutorials of making arcs or curves

Untitled.png

Advertisement

The exact same way you draw a normal line just put points on a mathematical curve.

For tutorials on this you need to search the name of the curve you want. For example I found this:  http://www.openglprojects.in/2015/12/drawing-bezier-curves-in-opengl-c.html#gsc.tab=0 while searching for " opengl bezier curve tutorial".

Edit: For a radar you will have a much easier time using sprite sheets.

thanks for replying @Scouting Ninja i have another question can i render an texture or draw anything behind sprite sheet 

behind the arc i need render some dots or an image can it be done.

13 minutes ago, markshaw001 said:

can i render an texture or draw anything behind sprite sheet 

If it has a alpha yes. Alpha sorting is a bit of a pain when your new however it is important so learning it isn't a bad idea.

Have you considered using a engine or is learning how to do these things your main goal?

i have not tried an engine i am a little familiar with unity developed a small game for a semester project but the main goal is to develop in opengl or some other API without using an engine 

This topic is closed to new replies.

Advertisement