Jump to content

Hdk Vray


Recommended Posts

Hi Everybody....

There is a strange problem I am facing while creating VRAY procedure.

My VRAY code takes two inputs. A source Geometry and a Template

Geometry.

And copies source geometry on each point of template geometry. It is

same as Copy SOP but only a VRAY procedure.

Inside the code, I am using "queryObject" and "queryGeometry" to get

pointer to gdp.

Here sgdp is Source_Geometry and tgdp is Template_Geometry.

The code is like,

for(i=0;i<tgdp->points().entries();i++)

{

ppt = tgdp->points()(i);

gdp->clearAndDestroy();

gdp->merge(*(GU_Detail *)sgdp);

xform.identity();

xform.translate(ppt->getPos().x(),ppt->getPos().y(),ppt->getPos().z());

gdp->transform(xform);

final_gdp->merge(*(GU_Detail *)gdp);

}

And I am using final_gdp as the output.

Now the thing is, The code compiles normally and renders properly when

my camera is somewhere near to the template object. As my Camera moves

around,

the x,y,z values of template points sometimes show correct values and

renders properly and sometimes the values are wrong and doesn't render

the object(or may be the object moves out of screen because of the

values)..I checked it using console.

I don't know why the values are changing as my template object is

static.

What is the problem with getPos. According to my knowledge it returns

the world position, so the camera position should not matter.

----iamjaideep80

Jaideep Khadilkar

TD, Sciclone Motion Graphics

Link to comment
Share on other sites

HI......

Is the problem related to LOD parameter passed to render function. Because LOD is the only parameter that changed as the camera changes. I commented all code that was modyfying anything and only checked the point pos x,y,z for my Template Geometry. But still it is changing as I change my camera. The problem is with getPos function. Thats for sure. Is LOD affecting the getPos function. I am not using lod in my code anywhere...

----iamjaideep80

Jaideep Khadilkar

TD, Sciclone Motion Graphics

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...