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

  • Home
  • SEARCH
  • 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 7988953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:36:31+00:00 2026-06-04T12:36:31+00:00

I want to draw text over 3D point. The text request 2D points rect

  • 0

I want to draw text over 3D point. The text request 2D points rect x y x1 y1

i use irrlight engine.
But i need just formula.

i have:
core::vector3df point;

core::rect<s32> viewport = driver->getViewPort();
core::matrix4 matProj = driver->getTransform(video::ETS_PROJECTION);
core::matrix4 matView = driver->getTransform(video::ETS_VIEW);
core::matrix4 matWorld = driver->getTransform(video::ETS_WORLD);


core::quaternion point_qua(point.X ,point.Y , point.Z , 1);

// formula
point_qua = point_qua*(matWorld*matView*matProj);

std::cout << "\nX=" << point_qua.X;
std::cout << "\nY=" << point_qua.Y;

but x and y coord not correct. They give me negative y. And text drawing at top left.
Is this formula correct?

  • 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-06-04T12:36:33+00:00Added an answer on June 4, 2026 at 12:36 pm

    Almost.

    The formula you have gives you the position in OpenGL screenspace, which goes from [-1, -1] to [1, 1]. Positions in OpenGL screen space look like this:

    [-1, 1]-----------------------------------------[1, 1]
       |                                               |
       |                                               |
       |                                               |
       |                                               |
       |                                               |
       |                    [0, 0]                     |
       |                                               |
       |                                               |
       |                                               |
       |                                               |
       |                                               |
    [-1, -1]----------------------------------------[1, -1]
    

    To get it in pixels, transform as follows:

    pixelsX = (1 + point.X) * Viewport.Width / 2;
    pixelsY = (1 - point.Y) * Viewport.Height / 2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use core text to draw string that can span over 100
I want to draw some text on the wallpaper and make it move, but
I want to draw text into UIView 's subview using drawInRect:withFont:lineBreakMode call but that
I want to draw text just like the following style -- the image is
I want to draw ImageView with text over a relative layout with 9patch background.
I want to draw text on canvas., how to do it any sample example?
I want to draw a text with 32 bit transparency on a graphics object.
I have created a new Bitmap object and now want do draw some text
alt text http://www.imagechicken.com/uploads/tn1270646423002339600.png I want to draw like that. How do I draw like
I want to draw a text with different colors and the only way that

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.