Page 1 of 1

billboard collision in tutorial 7

Posted: Wed Mar 14, 2007 12:43 pm
by jingquan
As seen in tutorial 7, the target (that yellow sphere in the center of the screen) points at where you are looking and it appears to be on the walls.

I figure it out myself it has something to do with:

Code: Select all

Dim line As Line3D = New Line3D 
line.start = camera.Position 
line.end = line.start + (camera.Target - line.start).Normalize * 1000 
Dim intersection As Vector3D 
Dim tri As Triangle3D 
If smgr.SceneCollisionManager.GetCollisionPoint(line, selector, intersection, tri) Then 
bill.Position = intersection
I tried inserting it into my project but gotten funny results. e.g. the target moved from the center of the screen.

How can I replica the function seen in tut 7???