Jump to content


- - - - -

Novodex Raycastin Woe's


  • You cannot reply to this topic
No replies to this topic

#1 jonj

    New Member

  • Members
  • Pip
  • 1 posts

Posted 24 February 2006 - 06:51 PM

Hi,

I'm trying to do some raycasting in Novodex, so I can make the cube I click on with the mouse the selected actor. I'm using DirectX, specifically Direct Input to get the mouse position (x,y,x). Then my camera uses camerapoistion to specify position and PointCamera as the vector where the camera is pointing. I know I probably need to use the Pointcamera somehow, possibly through DX3DMatrixLookAtH.

Please can anyone point me in the right direction, or show me some code that already has it working, my deadlines approaching .... Thanks Jon

orig = NxVec3(camerapoistion.x, camerapoistion.y, camerapoistion.z);
dir = NxVec3(mousepoisition.x, mousepoisition.y, mousepoisition .z );
NxRay ray(orig, dir);

NxShape* closestShape = gScene->raycastClosestShape(ray, NX_ALL_SHAPES, hit);
if (closestShape)
{
gSelectedActor[0] = closestShape->getActor();





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users