Advertisement Jump to content
Sign in to follow this  

initializing an LPD3DVECTOR

This topic is 3660 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, this one is pretty quick and dirty, but I didn't succeed in solving it myself. All I'm trying is to get the position of my camera in direct3d (C++), and for that I need an LPD3DVECTOR... sure, no problem. I define one at the beginning of my function. But the camera.GetPosition(LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR return-position) wants the vector allready initialised. I know how to initialise standard datatypes, but how do I initialise a LPD3DVECTOR? simply initialising it with NULL doesn't help, the SDK documentation refused to be of much help and I didn't find the problem on the net either. I guess it's really a trivial problem anyone with an apropriate bit of C++ expirience knows how to deal with, but alas my expirience so far is limited to visual basic, wich didn't exactly teach me much about initialising, pointers etc.

Share this post

Link to post
Share on other sites
LPD3DVECTOR is defined as a pointer (*) to a D3DVECTOR3 structure.
You can declare a variable which has the structure type:


and use the address-of operator (&) to get a pointer to that:

camera.GetPosition(reference, &vec);

EDIT: like SiCrane said.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!