Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Make 2D Circle around 3D Sphere

Author
Message
Hanne
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location:
Posted: 1st May 2012 18:00
Hey Guys.

Current Situation:
Im Generating a Random Universe, A Sun in the Center, Planets orbiting around.

I am abled to select a Sphere, works by getting the object id.
A Menu pops up and Shows the different properties like speed - planet size ect.

Now i want to make a kind of \"highlight\".

I could easily clone that object, change the size and make it wireframe. but that looks really like ...

Okay, now i decided to make a 2d Circle around that, like a Halo, but there is no way to get this running. When i Take the X and Y Coordinates of the selected sphere and make a circle, the circle uses the coordinate-system of the window and appear in the upper left of the screen.

f.e - the sun always has the position 0,0,0 - so the circle uses them too....

how do i solve that? Is that even possible?

thanks in advance!
Hanne
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location:
Posted: 1st May 2012 19:20
Okay, sorry for that post, but i figured it out how to use Sprites
Never mind..
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 1st May 2012 19:51
To be honest, I would cheat. I would create a plain object facing the camera and have a circle texture in it. It's probably so much easier to scale the plain object to just bigger than the sphere than it is to work out the screen coordinates of the sphere, then the size of the circle you would need, etc, and it's faster.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 1st May 2012 23:25
Quote: "Okay, sorry for that post, but i figured it out how to use Sprites"

I would use WLGFx's suggestion if I were you. The problem with sprites is they are not automatically rescaled to match screen res whereas 3D is. In other words a 3D plain that was textured would be better than having to scale a sprite (which Ironically is actually a 3D ent but it is handled completely differently).

Login to post a reply

Server time is: 2024-05-17 03:06:32
Your offset time is: 2024-05-17 03:06:32