• Create Account

### #Actualstc.5421

Posted 06 December 2012 - 09:20 AM

1- "p" is your intersected point

2- "v1,v2,v3" are your intersected face vertices

3- "N" is your face normal or you can calculate it from your vertices
{
A = v2 - v1
B = v3 - v1
N = normalize( cross( A , B ) )
}

4- Calculate your Up and Right vector
{
up = normalize( p - v1 )
right = cross( up , N )
}

{
Q1 = p + up * scale
Q2 = p - up * scale
Q3 = p + right * scale
Q4 = p - right * scale
}

### #2stc.5421

Posted 06 December 2012 - 09:12 AM

1- "p" is your intersected point

2- "v1,v2,v3" are your intersected face vertices

3- "N" is your face normal or you can calculate it from your vertices
{
A = v2 - v1
B = v3 - v1
N = normalize( cross( A , B ) )
}

4- Calculate your Up and Right vector
{
up = normalize( p - v1 )
right = cross( up , N )
}

{
Q1 = p + up * scale
Q2 = p + up * scale * -1
Q3 = p + right * scale
Q4 = p + right * scale * -1
}

### #1stc.5421

Posted 06 December 2012 - 09:11 AM

1- "p" is your intersected point

2- "v1,v2,v3" are your intersected face vertices

3- "N" is your face normal or you can calculate it from your vertices
{
A = v2 - v1
B = v3 - v1
N = normalize( cross( A , B ) )
}

4- Calculate your Up and Right vector
{
up = normalize( p - v1 )
right = cross( up , N )
}