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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:45:28+00:00 2026-05-23T22:45:28+00:00

I have a Graphics3D object. I want to export it as a bitmap, and

  • 0

I have a Graphics3D object. I want to export it as a bitmap, and to calculate the bitmap-pixel coordinates of certain 3D points.

Mathematica obviously does a projection from 3D objects to 2D pixel coordinates when it draws the 3D graphic. How can I find out what this projection is?

I’d rather avoid doing lots of tricky geometrical calculations based on ViewVector and ViewAngle and ImageSize and BoundingBox. Is there a shortcut?

Damon.

  • 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-23T22:45:29+00:00Added an answer on May 23, 2026 at 10:45 pm

    You could GeometricTransform using the option "Transformation" -> "Perspective". Suppose your projected chess board looks something like this

    img = Image@
      Plot3D[0, {x, -1, 1}, {y, -1, 1}, Mesh -> 7, 
       MeshShading -> {{Black, White}, {White, Black}}, Boxed -> False, 
       AxesEdge -> {{-1, -1}, {-1, -1}, None}, AxesOrigin -> {-1, -1, 0}]
    

    3D chessboard

    To find the projection you will need the coordinates of at least 4 control points in img for which you know the {x,y}-coordinates. There probably are methods to have Mathematica find these coordinates automatically but you can select them manually by right-clicking on img and choosing “Get Coordinates”. Click on the control points of your choice (in this case I chose the 4 corners of the chessboard) and
    copy/paste their coordinates to a new line. You should get something like

    controls = {{13.5`, 151.5`}, {235.5`, 68.5`}, 
       {332.5`, 206.5`}, {139.5`, 262.5`}};
    

    The projection function and matrix then become

    transform = FindGeometricTransform[controls,
       {{0, 0}, {8, 0}, {8, 8}, {0, 8}}, 
       "Transformation" -> "Perspective"][[2]]
    transfMat = TranformationMatrix[transform]
    

    Note that I chose the chessboard to be an 8×8 square centred at {4,4}, but you can choose any square.

    A point {x,y} on the chessboard will now correspond to the point in img with pixel coordinates transform[{x,y}] or, using the projection matrix, (transfMat[[{1,2}]].{x,y,1})/(transfMat[[3]].{x,y,1}). So for example, to put a marker on D6, which would be at position {x,y}={4-1/2,6-1/2} in my 8×8 square, you could do something like

    ImageCompose[img, Image[BoxMatrix[2]], Round[transform[{4 - 1/2, 6 - 1/2}]]]
    

    marker

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

Sidebar

Related Questions

I have a Bitmap object on which I want to draw some text. This
I have an application that I want to export high-resolution (or rather, high pixel
I have a PNG image that has an unsupported bitmap graphics context pixel format.
Say if I have a Java Graphics object, and I want to draw a
I want to do something relatively simple: I want to create a Bitmap object
I have a Graphics object of JPanel and that is working fine: import java.awt.Color;
In my program I want to draw a simple score line graph. I have
I want to move a Graphics object towards the cursor when the user clicks
Hello i have designed a maze and i want to draw a path between
I want to convert the html tag objects to json object in the javascript

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.