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 6356975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:04:31+00:00 2026-05-24T23:04:31+00:00

situation I’m implementing a height field editor, with two views. The main view displays

  • 0

situation

I’m implementing a height field editor, with two views. The main view displays the height field in 3D enabling trackball navigation. The edit view shows the height field as a 2D image.
On top of this height field, new images can be applyed, that alter its appearence (cut holes, lower, rise secific areas). This are called patches.
Bouth the height field and the patches are one channel grayscale png images.

For visualisation I’m using the visualisation library framework (c++) and OpenGL 4.

task
Implement a drawing tool, available in the 2D edit view (orthographic projection), that creates this patches (as seperate images) at runtime.

important notes / constrains

  • the image of the height field may be scaled, rotated and transposed.
  • the patches need to have the same scale as the height field, so one pixel in the patch covers exactly a pixel in the height field.
  • as a result of the scaling the size of a framebuffer pixel may be bigger or smaller than the size of the height field/patch image pixel.
  • the scene contains objects (example: a pointing arrow) that should not appear in the patch.

question
What is the right approach to this task? So far I had the following ideas:

  • Use some kind of QT canvas to create the patch, then map it to the height field image proposions and save it as a new patch. This will be done everytime the user starts drawing, this way implementing undo will be easy (remove the last patch created).
  • Use an neutral colored image in combination with textre buffer objects to implement some kind of canvas myself. This way every time the user stops drawing the contents of the canvas is mapped to the height field and saved as a patch. Reseting the canvas for the next drawing.
  • Thre are some examples using a frame buffer object. However I’m not sure if this approach fits my needs. When I use open gl to draw a sub image into the frame buffer, woun’t the resultig image contain all data?
  • 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-24T23:04:31+00:00Added an answer on May 24, 2026 at 11:04 pm

    Here is what I ende up:

    I use the PickIntersector of the Visualisation Library to pick agains the Height Field Image in the edit view.
    This yealds local coords of the image.
    There are transformed to uv coords, wich in turn get transformed into pixel coords.
    This is done when the user presses a mouse button and continues to happen when the mouse moves as long as its over the image.

    I have a PatchCanvas class, that collects all this points. On commands it uses the Anti-Grain Geometry library to accually rasterize the lines that can be constructes from the points.

    After that is done the rasterized image is divied up into a grid of fixed size. Every tile is scanned for a color different then the neutral one. Tiles that only contain the neutral color are dropped. The other are saved following the appropied naming schema, and can be loaded in the next frame.

    Agg supports lines of different size. This issn’t implemented jet, but the idea is to pick to adjacened points in screen space, get those uv coords, convert them to pixels and use this as the line thickness. This should result in broader strockes for zoom out views.

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

Sidebar

Related Questions

Situation: I am using the Navigation Based Application project template. And my root view
Situation Well, as you can see below, I have a main App, creating a
Situation: I have an Xcode project based on the Navigation-Based-Application template. So that means
Situation: Have a SET field called country with values ('us','uk','fr','intl') When I go to
Situation: Set two instance variable Display variables in the console (I know that I
Situation: The UI of an app is based on a UISplitView with two UINavigationController
Situation In my Wicket application, I have a page which contains two tags. Each
Situation I have two .NET solutions ( Foo and Bar ) and a common
Situation I have the following Sitecore Lucene config: New index, type=Sitecore.Search.Index, Sitecore.Kernel Contains two
Situation: When quitting a main activity of an android app, I wish to call

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.