ParallelGraphics Forums
SDK
You are here:
[Forums]
::
[General]
::
[SDK]
All forums
How to use forums
Favorites
Services
Registration
Registration
Forgot your password?
Help
Help
Support
Quick search
Subscribe to newsletters
email:
password:
 
General
-
SDK
[reply]
[back to forum]
[new message]
[all forums]
Subject:
MFVec3f.Add Method
Sender:
mutafchiev@gmx.de
13.06.07 13:31
Hi there,
I create "IndexedFaceSet" Node with CreateNode().
I take the field "coord" and I put some "Coordinate" Node
with put_Value(Coordinate). I create this "Coordinate" Node
with CreateNodeFromString. It works but this is not what I want. My task is to create "Coordinate" Node with CreateNode(), to take its field "point" as IMFVec3fObject and to fill it with values using MFVec3f.Add Method. The values are for example: point [2 0 -2, 2 0 2, -2 0 2]
I tried it, I don't become any error message but I don'see the
object wich I created this way:
VARIANT before;
before.vt = VT_ERROR;
before.scode = DISP_E_PARAMNOTFOUND;
int x, y, z;
for(int i=0; i<coordPoints.size(); ){
x = coordPoints[i];
++i;
y = coordPoints[i];
++i;
z = coordPoints[i];
++i;
// copied from the forum
// Create the safe array
const int iCount = 3;
SAFEARRAYBOUND sSABound[1];
SAFEARRAY *pSA;
sSABound[0].cElements = iCount;
sSABound[0].lLbound = 0;
pSA = SafeArrayCreate(VT_VARIANT, 1,
sSABound);
// Gain access to the values
VARIANT *pVal = NULL;
HRESULT hResult = SafeArrayAccessData(pSA,
(void**)&pVal);
if (SUCCEEDED(hResult)) {
// Populate the array
VariantInit(pVal);
pVal[0].vt = VT_R4;
pVal[0].intVal = x;
VariantInit(pVal + 1);
pVal[0].vt = VT_R4;
pVal[0].intVal = y;
VariantInit(pVal + 2);
pVal[0].vt = VT_R4;
pVal[0].intVal = z;
SafeArrayUnaccessData(pSA);
}
else {
SafeArrayDestroy(pSA);
return false;
}
// Initialise the variant
VARIANT sVariant;
VariantInit(&sVariant);
// Set the type and value
sVariant.vt = VT_ARRAY | VT_VARIANT;
sVariant.parray = pSA;
if(SUCCEEDED(m_IMFVec3fObject->Add(&sVariant,
&before)))
AfxMessageBox(L"Add Variant Vector OK");
}
Do you see something wrong in this code?
I am glad for any suggestions.
Regards
Stoyan
[reply]
[back to forum]
[new message]
[all forums]
MFVec3f.Add Method
/
mutafchiev@gmx.de
/ 13.06.07 13:31
Messages in thread:
1
[reply]
[back to forum]
[new message]
[all forums]
© 1998-2007
ParallelGraphics
. All rights reserved.
Terms of use
.