Jump to content


rendering a target box on a model in a 3D world


  • You cannot reply to this topic
6 replies to this topic

#1 chenbin_osu

    New Member

  • Members
  • PipPip
  • 10 posts

Posted 31 August 2005 - 01:10 AM

Hello,

I'm trying to think of a good and efficient way of rendering "selection" boxes on a model in a 3D world.

As an example, here's a screenshot of what I want:

Posted Image

The model on the top has a green target around it. This is what I want to render.

Any ideas are apprecaited. Thanks!

#2 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 31 August 2005 - 05:18 AM

Render a billboarded quad over the target. You should be able to extract the necessary size from the bounding box of the target.
If Prolog is the answer, what is the question ?

#3 bladder

    DevMaster Staff

  • Moderators
  • 1057 posts

Posted 31 August 2005 - 06:51 AM

Another way to do it: You can project the 3D world coordinats of your model to screen space - the opposite of picking. You can use this x,y point in screen space and just render a 2D box around the point in screen sspace. AFAIK, that's what is usually done because you can still see the target box even when an object goes behind something (in the games I can recall right now)

#4 Methulah

    Senior Member

  • Members
  • PipPipPipPip
  • 727 posts

Posted 31 August 2005 - 08:16 AM

Coolio. How did that funky effect in Warhammer 40K work out where when the units went around buildings, a coloured sillouhette of them showed up? That effect rocked, and I was wondering if it is possible/easy to do in DirectX, in particular Source Engine?
Django Merope-Synge :: django@white-epsilon.com
Lead Designer/Project Manager - White Epsilon

#5 zavie

    Member

  • Members
  • PipPip
  • 91 posts

Posted 31 August 2005 - 10:46 AM

Can you give some link to a screenshot? I have never seen this game, but if I understand what you mean, I think I have an idea...

#6 dj

    New Member

  • Members
  • Pip
  • 4 posts

Posted 04 September 2005 - 08:12 AM

when you render to screen space, how would you be able to find the x,y?

#7 zavie

    Member

  • Members
  • PipPip
  • 91 posts

Posted 04 September 2005 - 07:26 PM

Multiply the object vector by the modelview matrix, and then by the projection matrix.
:-)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users