Author Topic: help plaease how to Highlight a 3d object  (Read 2418 times)

Offline zerofox

  • byte
  • *
  • Posts: 15
    • View Profile
help plaease how to Highlight a 3d object
« on: July 04, 2013, 05:53:41 am »
Guys,

How to higlight a 3d object? attached is the image what i'm trying to do, you see there is a red ball as the 3d object and i want to higlight this object with the square line black color. how to achieve this? something like 2d drawing that is should know of to draw this line?

Thanks guys

[attachment deleted by admin]

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: help plaease how to Highlight a 3d object
« Reply #1 on: July 04, 2013, 07:17:54 am »
You can create a texture that contains the 2d frame and blit it. You can use Interact2D to get some 2d coordinates that relate to the object to know the blitting location.

Offline zerofox

  • byte
  • *
  • Posts: 15
    • View Profile
Re: help plaease how to Highlight a 3d object
« Reply #2 on: July 04, 2013, 07:49:36 am »
Hi Egon,

Thanks for replying. ok i can use projectCenter3D2Dright to get the center of 3d object to 2d coords and attach the bitmap with square line. But how to get the width and height of the 3d object? i mean i want the hightlighting square line to scale if the 3d object going far or near, so the square line get bigger if the object going near and shrink if going far.

 So looks like i need to get the corner top, left corner, right corner, and bottom of 3d object's vertex and using project3D2D to get the width and height? 

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: help plaease how to Highlight a 3d object
« Reply #3 on: July 04, 2013, 09:13:25 am »
Either that or, much simpler, scale it according to the distance based on some magic number that depends on the object.