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.

Dark GDK / Looking for some pointers - 3d Objects & 2d Objects, Creating a 2d box around a 3d object

Author
Message
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 4th Mar 2008 02:10
Now that my 3d card is working again with Dark DGK, patching to the latest driver and version of DGK, I can continue with my work.

? The question I am looking out is how to return the 2d values of a 3d object on the screen with in the camera’s view window.

Classic example would be like a targeting reticule popping (2d object) up on a 3d (object) bad guy, this is nothing more than a sprite or line image slapped onto the screen where the object is at. Not just a gun site at fixed position on the screen.
Currently using Visual Studio 8 c++, the basic Dark DGK for c++.

There are many answers but just one question" ~ Jerilith the Mad
Rye
21
Years of Service
User Offline
Joined: 30th May 2003
Location: United Kingdom, Blackrod
Posted: 4th Mar 2008 02:56
for the example:

Method A:

int dbObjectScreenX ( int iObject )
Returns the screen co-ords of the specified object.

Method B:
Have a 3d plain that always faces the camera positioned at the same point as the object. Using dbDisableObjectZDepth(), it'll be drawn over standard polys. A simple line of sight check can then be used to show or hide the plain as desired.

A is probably easier to implement. But if you want the image to scale so it covers the entire object, it could be difficult.
In this case, B would be better as when the object it closer, the plain is also closer. So only initial scaling is required.
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 4th Mar 2008 03:34
Thanks, I id not see that in the Dark GDK help file. More than likely would have to dig into the headers. But that IS exactly what I am looking for. Method "A" is perfect. Just got to make sure you add some error checking for the screen. I got some negative and over the top numbers that where bigger and smaller than the screen size. Now I can go ahead and add my Gui to check for 3d objects. Great help. thanks Rye.

There are many answers but just one question" ~ Jerilith the Mad

Login to post a reply

Server time is: 2024-11-20 03:33:18
Your offset time is: 2024-11-20 03:33:18