hi, i am coding a 2d game where i click on the screen and the unit moves there.
but how can i check if theres a nonwalkable area beetween the starting and ending point ? i mean, how can i check if the line from starting to ending point crosses the polygon which marks my non walkable terrain.
i read a lot about selection but glupickmatrix only lets me define a cube not a line
how can this be done
read it. its an opengl question. i dont want an algorythm that calculates a way around objects. i want to know how to check if an object is in my way , in opengl.
i read a lot about selection but glupickmatrix only lets me define a cube not a line how can this be done
actually, selection could be used for collision detection, but would require a great deal of thought and effort to make it practical (if at all possible). having never attempted it myself, i can’t say for sure, but most anything is possible. if you find a way, please post your results!