Hi Estee,
Hello all,
I read about some special parameters of OpenSG, OSGProjectionMatrix, OSGViewMatrix, etc.
And I want to use it in my Cg program.
Instead using of glstate.matrix.mvp, I want to use OpenSG special parameters.
So I did belows.
First, I modified "checkOSGParameters" function in OSGCGChunk.cpp file because I did not
call "updateProjectionMatrix" function. (Of course, I do rebuild and use new library.)
else if(parameter->getName() == "OSGProjectionMatrix")
{
paramtercbfp fp = updateProjectionMatrix;
_osgParametersCallbacks.push_back(fp);
}
ups thanks for the hint I forgot to add this one.
And I registered some parameters before the "glutMainLoop" function.
_cgparameter->setUniformParameter("OSGProjectionMatrix", Real32(0.0));
_cgparameter->setUniformParameter("OSGViewMatrix", Real32(0.0));
Then, in my vertex program I added new uniform parameters and used it.
void C7E1v_reflection(float4 position : POSITION,
float2 texCoord : TEXCOORD0,
float3 normal : NORMAL,
out float4 oPosition : POSITION,
out float2 oTexCoord : TEXCOORD0,
out float3 R : TEXCOORD1,
uniform float3 eyePositionW,
uniform float4x4 modelToWorld,
uniform float4x4 OSGProjectionMatrix,
uniform float4x4 OSGViewMatrix)
Instead of using glstate.matrix.mvp, I tried many cases with OpenSG special
parameters like belows.
float4x4 modelViewProj = transpose(OSGProjectionMatrix)*transpose(OSGViewMatrix);
float4x4 modelViewProj = OSGProjectionMatrix*OSGViewMatrix;
float4x4 modelViewProj = transpose(OSGViewMatrix);
float4x4 modelViewProj = OSGProjectionMatrix;
But it seems it doesn't work. :(
If there is anybody who tried this already, please tell me what I'm wrong.
I just added the code but never tested it, I will check this tomorrow.
Andreas
Thank you.
Best regards,
EsteeHS^µéšŠX¬²š'²ŠÞu¼ƒŠÇ(½êÄjÌ‹Š{±2(+jب�+kj×
‰ë®‰ˆÁb�Û"š™^¶‡è–Z0F†�™ªl²ÚÚŠm~Šðj·Z®Øœ•ë"�ú+™«b½åžmƬ¶Æ§vj+xgz÷«ÊØbž
¨ºwžvÚ zÛ©¶‹)yç_jËa¶Úý§l¢Çgr‰¿iØ�¾í©e¡È�^÷j)ÉrC©z{
ºÇ«²f¢–)à–+-:—§²¬z»%ŠËl²‹«qçè®§zØm¶›?þX¬¶Ë(º·~ŠàzwþX¬¶ÏåŠËb�ú?¢—§²¬ers=
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users