Results 1 to 10 of 121

Thread: G.T.A.2 Map Editor

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #20
    Quote Originally Posted by hwnd View Post
    It would be nice to have that 3D text thingy in nxPascal.
    I know you have fonts and stuff, but there is no functionality for 3D text that always faces the camera.
    Sorry, not having easy answer to this. There are many ways you can draw 3D text with nxPascal, i can tell a few:

    1) Using gluProject() you can transform 3D coordinate into where it's located on the 2D screen. Then you can draw the font in 2D ortho mode (nx.Enable2D()). There is nx.GetViewDetails() which will get you the OpenGL view details needed for gluProject() call.

    2) If you want truly 3D text like that guard name, and floating combat text like that:
    http://static.ddmcdn.com/gif/wow-guide-4.jpg
    you could use a little matrix math. This could be simpler and more efficient if you use the nxPascal camera class, instead of relying on OpenGL matrix commands. To turn rendering towards camera, you would first read the camera rotation matrix and invert it. Multiply camera with the inverted rotation matrix. Then there's matter of drawing the font... 3D coordinates are usually in smaller scale, 1.0 meaning roughly 1 meter, whereas 1.0 in 2D is 1 pixel. So that must be drawn centered (there is draw function for that) and scaled smaller.

    Yes, map rendering is limited, because i can't draw whole map at once. Fps goes down to 1-2 then.
    Also about minimap, you could render it to framebuffer once, and then draw only the framebuffer afterwards. It's just 1 texture in practise, and wouldn't hurt FPS at all. I tried to show some use of framebuffers in the demos.
    Last edited by User137; 16-02-2013 at 05:35 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •