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 / C++/DGK Finding the 2d position of 3d objects with Multiple Cameras

Author
Message
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 9th Feb 2009 06:16
Got a question. I know if I use the dbObjectScreenX & Y commands I can get the 2d Position of a 3d object on screen. The question how does this work if I got Multiple Cameras, since both objects are the same and they are both on screen at the same time?

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

Attachments

Login to view attachments
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 9th Feb 2009 07:42 Edited at: 9th Feb 2009 07:45
this function is part of my library:



Just make sure you #include "d3dx9math.h" first.

This will return a range between 0.0 and 1.0 when inside the screen, you can then multiply it by the screenWith/Height on the .x and .y members of the return vector respectively.

Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 10th Feb 2009 18:33
Alright I will poke at that. thanks.

There are many answers but just one question" ~ Jerilith the Mad
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Feb 2009 18:36
You could also try using dbSetCurrentCamera() - you may need to add in the camera views starting coordinates to the values you get to give you display coordinates instead of camera view coordinates.

Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 11th Feb 2009 22:59
Alright, that sounds like what I might be looking for. I will try that to. If that works , then I should be able to make my sub system targeting system a little more friendlier.

Thanks

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

Login to post a reply

Server time is: 2024-09-30 17:23:29
Your offset time is: 2024-09-30 17:23:29