Jump to content

Change radius of sphere primitive in vex


ianwww

Recommended Posts

I've created a sphere primitive in vex, using:

centre_pt = addpoint(0, pos);   
sphere_prim = addprim(0, 'sphere', centre_pt);

I want to be able to vary its size in the viewport but can't work out how to do it.  When a sphere prim is added using a SOP, the sphere's size can be changed using scale (the Uniform scale slider).  I thought that this vex would therefore do the same thing:

setprimattrib(0, 'scale', sphere_prim, chf('sphere_size'), 'set');

but changing chf('sphere_size') has no effect on the sphere's size. (I've also tried replacing 'scale' with 'radius', and also with 'radx', 'rady' and 'radz'.)

I've found this link cgwiki which explains how to do it for a prim that has multiple points but a sphere prim only has its single central point.

How can I change a sphere prim's size in vex?

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