Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualMedo3337

Posted 05 January 2013 - 06:13 PM

Okay, I tried the following but can't get it to work yet:

float distance = 1000.0f;
D3DXVECTOR3 rayFrom = camera->GetPosition();
D3DXVECTOR3 rayTo = ScreenToWorld(hWnd, WINDOW_WIDTH/2, WINDOW_HEIGHT/2, camera->viewMatrix(), camera->projectionMatrix());
D3DXVECTOR3 direction;
D3DXVec3Normalize(&direction, &(rayTo - rayFrom));
D3DXVec3Scale(&direction, &direction, distance);
Raycasting(rayFrom, direction);

#4Medo3337

Posted 05 January 2013 - 06:12 PM

Okay, I tried the following but can't get it to work yet:
float distance = 1000.0f;
D3DXVECTOR3 rayFrom = camera->GetPosition();
D3DXVECTOR3 rayTo = ScreenToWorld(hWnd, WINDOW_WIDTH/2, WINDOW_HEIGHT/2, camera->viewMatrix(), camera->projectionMatrix());
D3DXVECTOR3 direction;
D3DXVec3Normalize(&direction, &(rayTo - rayFrom));
D3DXVec3Scale(&direction, &direction, distance);
Raycasting(rayFrom, rayTo);

#3Medo3337

Posted 05 January 2013 - 06:11 PM

Okay, I tried the following but can't get it to work yet:
float distance = 1000.0f;
D3DXVECTOR3 rayFrom = camera->GetPosition();
D3DXVECTOR3 rayTo = ScreenToWorld(hWnd, WINDOW_WIDTH/2, WINDOW_HEIGHT/2, camera->viewMatrix(), camera->projectionMatrix());
D3DXVECTOR3 direction;
D3DXVec3Normalize(&direction, &(rayTo - rayFrom));
D3DXVec3Scale(&direction, &direction, distance);
Raycasting(rayFrom, rayTo);

#2Medo3337

Posted 05 January 2013 - 06:10 PM

Okay, I tried the following but can't get it to work yet:


float distance = 1000.0f;
D3DXVECTOR3 rayFrom = camera->GetPosition();
D3DXVECTOR3 rayTo = ScreenToWorld(hWnd, WINDOW_WIDTH/2, WINDOW_HEIGHT/2, camera->viewMatrix(), camera->projectionMatrix());
D3DXVECTOR3 direction;
D3DXVec3Normalize(&direction, &(rayTo - rayFrom)); D3DXVec3Scale(&direction, &direction, distance);
Raycasting(rayFrom, rayTo);

#1Medo3337

Posted 05 January 2013 - 06:10 PM

Okay, I tried the following but can't get it to work yet:


float distance = 1000.0f; D3DXVECTOR3 rayFrom = camera->GetPosition(); D3DXVECTOR3 rayTo = ScreenToWorld(hWnd, WINDOW_WIDTH/2, WINDOW_HEIGHT/2, camera->viewMatrix(), camera->projectionMatrix()); D3DXVECTOR3 direction; D3DXVec3Normalize(&direction, &(rayTo - rayFrom)); D3DXVec3Scale(&direction, &direction, distance); Raycasting(rayFrom, rayTo);

PARTNERS