Improve -p option to support true perspective projections

Open
#8,816 14 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Start by locating GMT's source entry point for the -p option and the existing General Perspective projection logic. Compare their projection and 3D transformation behavior with the linked perspective-projection examples. Done means distant objects appear smaller and parallel lines converge toward vanishing points, with suitable validation added where the relevant projection behavior is tested.

Written by the indexing model from the issue text.

Description

feature request

The -p option currently produces what seems to be an orthographic projection, where all objects appear with the same size regardless of their distance from the viewer. This projection maintains parallel lines and provides no sense of depth.

A true perspective projection would make distant objects appear smaller, with lines converging toward vanishing points — similar to how real cameras or rendering engines represent 3D scenes. You can see this link for some interactive examples.

Implementation:
I would be interested in working on this improvement myself. However, I have not been able to find where in the GMT source the code handling the -p option (projection and 3D transformations) is implemented. Could you please indicate which source file(s) contain this logic?

I believe some of the required functionality might already exist in GMT through the General Perspective projection, so this could potentially be adapted or reused for implementing a true perspective view.

Dominant language
C
Stars
997
Forks
420
Avg merge
13h 27m
Merged PRs (30d)
47

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GenericMappingTools/gmt

All issues in GenericMappingTools/gmt

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.