Skip to main content
GameDev.net gamedev.net
🔒 Locked

use return value of D3DXVec3TransformCoord

Started by cozzie Mar 9, 2013 at 9:50 AM 1 replies 750+ views
Original Post
cozzie
cozzie

Hi.

Simple question.

I can't figure out how to use the D3DXVECTOR3 return value of:

D3DXVec3TransformCoord

It returns a D3DXVECTOR3*.

I have a a D3DXVECTOR3: mBoudingBox.min.

I tried:

mBoundingBox.min = D3DXVec3TransformCoord(NULL, &mBoundingBox.min, &mMatWorld);

But it says "no operator matches these operands".

Looking it up in MSN says that the return value is a D3DXVECTOR3*.

I have it working when I replace NULL by the output vector, but just want to know why it doesn't work as return value.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me
Paradigm Shifter
Paradigm Shifter

It returns the first argument. If you pass NULL as the first argument it won't work.

The return value is just an optional convenience if you wanted to use the returned vector as an argument to another function. Ignore the return value if you don't do that.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
cozzie
cozzie

Thanks, I'm not doing that so I'll just use the first parameter.

For code reading I found it maybe handy to read vector = D3DXvec... etc.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.