On 07/10/2015 at 08:34, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R16
Platform: Windows ;
Language(s) : C++ ;
---------
Hi, while looking for a good way to draw points in C4D's viewport i found the c4d_gl.cpp which contains some very intresting stuff but is not documented. With the expample file _gl_test_object.cpp
_ inside the sdk folder i managed to draw my points and every thing was fine.
Now im trying use the GlFactory class as a dynamic way of modifying huge Vector arrays with dierct C++ code this is very easy and also very fast with a GlFactory. Have a look inside the gl_test_object.cpp in you sdk folder in Line 227 if you add the Red vec4 and compile the Points will be Transformed by the vec4 in the Viewport.
> _....
> pFactory->HeaderFinished();
> pFactory->AddLine(VertexProgram, "oposition = (transmatrix * vec4(iposition.xyz, _
> 1.0))+ vec4(12.0,120.0,2.0,1.0);");
> _pFactory- >AddLine(VertexProgram, "ocolor = vec4(icolor.rgb, 1.0);");
> pFactory->AddLine(VertexProgram, "onormal = vec4(inormal.xyz, 1.0);");
> _
My question is how do i get the fransformed data back .
I know it can be displayed with DrawSubBuffer , I also tried to this after Drawing.
> void* pData = pBuffer- >MapBuffer(bd, m_pSubBuffer, VBReadOnly) // Map the buffer
> _Vector32* pvData = (Vector32* )pData;
> GePrint(String::VectorToString(pvData[0])); // Print the 1st Point pos in the buffer
> GePrint(String::VectorToString(g_pvParticlePoint[0])); // Print the 1st Orginal point
>
> _
But the Points are still the same. How can i get the GlProgramFactory programm modifying a the Buffer?Where are the points stored that the GlProgramFactory programm has modifyed??
If this isn't Possible is there a other way to to access the compiler used by the GlProgramFactor to compile a cpp file to dll and load it back in.
I hope you can understand my problem and help me.
Regards Caradhras
> _
> _
>
>