Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 585493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:00:31+00:00 2026-05-13T15:00:31+00:00

I have an application that draws 3-d map view marked up lines that show

  • 0

I have an application that draws 3-d map view marked up lines that show various features.
I am porting the map over to an OpenGL-ES architecture, but am having a bit of trouble working out how to display dashed lines.

Doing a lot of googling, I’ve found many references to the idea that drawing dashed lines and polygons were removed from OpenGL-ES as they can be easily emulated using textures triangles. That’s great, but I can’t find anyone that actually does this emulation and/or has a description of the steps involved.

An example, of one problem I have encountered trying to prototype out this concept is perspective squeezes my lines to invisible as they go towards the horizon. Using LINE_STRIP, this doesn’t happen, and the lines remain a constant width in the map.

Any advice on how to achieve dashed constant width lines in a perspective view would be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:00:31+00:00Added an answer on May 13, 2026 at 3:00 pm

    I believe you can apply a texture to a line, not just a triangle. You’ll need to set texture coordinates for each end of the line; the texture will be interpolated linearly along the line.

    The effectiveness of this solution should be invariant of whether you use lines or line strips – line strips are just a way to create lines with fewer vertices.

    There is one other problem: the tendency of the texture pattern to become compact as a line goes away from the camera. This happens because texture coordinate interpolation is perspective-correct even for lines (see section 3.5 of the GL spec).

    There are two ways to get around this:

    1. If you can calculate a “q” coordinate for your texture that undoes the perspective, you can restore screen-space texturing. This technique is probably too performance-expensive.

    2. You can project the texture in eye space (e.g. glTexGen).

    Texture coordinate generation is of course not available in GLES 1.1, but if you are using vertices by array, you can fake it by:

    • Setting your texture coordinate array to be your vertex coordinate array and
    • Using the texture matrix to “transform” the vertices.

    The disadvantage of this technique is that the texture pattern will be in fixed screen space – that is, the texture won’t run across the lines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an opengl application that loads a dxf and draws it on the
I have an application using Bing Maps that draws polygons on a map. For
I have an application that uses the mapview-overlay-manager code to draw map markers on
The question is a bit hypothetical. Let's say I have an application that draws
Hi I am creating an application that will draw lines over the top of
I have an application that gets the users location and draws a polyline on
I have a small application that uses a DrawingArea to draw a simple map
I have a google map component in my application that allows the user to
Ok, I have an application that uses a mapping system to draw lines. Each
I am developing an application that draws map. Currently my logic looks like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.