Jump to content

Chmod +rw P


Wolfwood

Recommended Posts

Howdi, here is a little question for you all,

The vex html help says,

* Although P is modifiable in the surface context, at the current time, changing P will not affect the render of the surface, only shading.

But when I try to write to P vcc throws the following error,

"test.vfl" line 4 ERROR (1031) Illegal attempt to modify read only variable "P"

P = P * 2;

        ^

REMARK (3003) 1 error and 0 warnings encountered

REMARK (3007) No output is generated due to errors in the source code

Here is a stupid sample that causes the above error,

surface
test() {
vector Nn;

P = P * 2;
Nn = normalize(computenormal(P));

Cf = diffuse(Nn);
}

Are the help files outdated and P is no longer modifiable? Or am I misunderstanding the vec docs and need more Red Bull? :P

jim.

Link to comment
Share on other sites

Hi Jim,

I am not sure if I understand you correctly, but I think that P *= 2 is not allowed as you were trying to write to "P". But I am scratching my head as to what the VEX html meant....

:wacko:

Can you try something like this?

surface
test() {
vector Nn;
vector newP = P * 2;

Nn = normalize(computenormal(newP));

Cf = diffuse(Nn);
}

Mo Red Bull?

ALex

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...