Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (741)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (823)
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 1387 times)
0 Members and 1 Guest are viewing this topic.
Offline arnzzz

Junior Newbie





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

Hey

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.
https://github.com/libgdx/libgdx/wiki/Path-interface-%26-Splines

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:

https://github.com/mattdesl/lwjgl-basics/wiki/LibGDX-Finger-Swipe

http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=26006
Pages: [1]
  ignore  |  Print  
 
 

 
xxMrPHDxx (12 views)
2017-11-21 16:21:00

xxMrPHDxx (10 views)
2017-11-21 16:14:31

xxMrPHDxx (10 views)
2017-11-21 16:10:57

Ecumene (113 views)
2017-09-30 02:57:34

theagentd (148 views)
2017-09-26 18:23:31

cybrmynd (246 views)
2017-08-02 12:28:51

cybrmynd (242 views)
2017-08-02 12:19:43

cybrmynd (242 views)
2017-08-02 12:18:09

Sralse (257 views)
2017-07-25 17:13:48

Archive (875 views)
2017-04-27 17:45:51
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

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
java-gaming.org 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‑gaming.org
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!