Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Need advice about a specific gfx technique  (Read 2047 times)
0 Members and 1 Guest are viewing this topic.
Offline arnzzz

Junior Newbie

« Posted 2017-03-14 04:22:02 »


So ive been playing around with making a basic strategy game using LibGDX, and so far ive just been using basic Shaperenderer Lines to represent paths in a visual way for the player.

It looks really bad, im aware that Shaperenderer is really just a debugging tool more than anything, so I started looking at some games I own and how they show paths.

Look below at two games that use the technique I would like to use.

How would you go about making this exact kind of thing? Would you use a Mesh?

Divided We Fall

Hearts Of Iron 4
Offline VaTTeRGeR
« Reply #1 - Posted 2017-03-14 19:27:19 »

The steps in the image correlate to the steps below.

1. You could start with a curve defined by your start/intermediate/end points.

2. Sample a sufficiently dense set of points from that curve.

3. Extrude points sideways along the (average of 2 touching lines) normal vector of the lines and throw your initial curve and sampled point set away.
You now have the vertices to form the mesh for the curve that gets rendered.

4. You now need to build the indices and UV coordinates to make the mesh complete.

5. Generate the tip of the arrow-curve, the tip can be pre-defined and just rotated and glued onto the end of the curve.

[The uv-coordinates are the same for every segment of your curve, except the arrow, you need two areas on your texture => segment and tip]

6. Throw it at opengl with some overlay render mode.

I'm pretty sure there's some kind of tutorial on this already, maybe even finished code from some other project.
Offline arnzzz

Junior Newbie

« Reply #2 - Posted 2017-03-14 22:47:59 »

Thanks for the break down, thats really helpful

I actually posted the same question on the Libgdx site and someone posted a good link:
Pages: [1]
  ignore  |  Print  

EgonOlsen (45 views)
2018-06-10 19:43:48

EgonOlsen (25 views)
2018-06-10 19:43:44

EgonOlsen (47 views)
2018-06-10 19:43:20

DesertCoockie (202 views)
2018-05-13 18:23:11

nelsongames (127 views)
2018-04-24 18:15:36

nelsongames (126 views)
2018-04-24 18:14:32

ivj94 (867 views)
2018-03-24 14:47:39

ivj94 (128 views)
2018-03-24 14:46:31

ivj94 (771 views)
2018-03-24 14:43:53

Solater (143 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!