Showing posts with label vex. Show all posts
Showing posts with label vex. Show all posts

Saturday, 10 June 2023

Frustum Culling in Vex

 This video shows you how to create an HDA that culls points outside the camera frustum using vex instead of using a volume.

I originally recorded an example of how to crash your scene by using a volume, but I cut it out because I didn't want to bore everyone to death.


Addition: I missed to check if the points are in front or behind the camera in the video, but you can solve that easily by checking the z value. It would look something like this:
"if((campos.x+padding.x) <0|| (campos.x-padding.x) >1 ||(campos.y+padding.y) <0 || (campos.y-padding.y) >1 || campos.z >0)"





Sunday, 14 May 2017

How to Create Custom Constraints for Your Ragdolls in VEX

In this tutorial I’m talking about how to create custom constraints in VEX for your ragdoll sim. Unfortunately I got over my 10 minutes limit, but there was just so much stuff that I needed to squeeze in.

It’s a bit technical so you probably need to have some basic understanding of VEX and ragdolls to be able to appreciate it.








If you don’t want to write the code yourself you can copy it from here:

int number_of_agents=npoints(1)-1;

string left_hand;
string right_hand;

int pointID_left;
int pointID_right;

for(int i=0; i<number_of_agents;i++){

left_hand=sprintf("mocapbiped3_%d/LeftFingerBase_To_LeftHandIndex1",i);
right_hand=sprintf("mocapbiped3_%d/RightFingerBase_To_RightHandIndex1",i+1);
   
    pointID_left=findattribval(0,"point", "name", left_hand,0);
    pointID_right=findattribval(0,"point", "name", right_hand,0);  
 
    int primID=addprim(0,"polyline", pointID_left, pointID_right);
    setprimattrib(0,"constraint_name", primID, "Pin","set");

}