I once again must agree with Lord Karnus on this issue. Ray casting has got to be the easiest way of detecting if an object has been selected by the mouse in my opinion. I use it in my games all the time, and its great.
Look into it.
OH Woe is Me!! Picking not working!
January 08, 2002 10:30 AM
Hi wojtos,
I wish I could help you out, sorry. I was wondering though, I noticed your map structure and was wondering how you got x, y and z to be a member of ''tile'' when ''tile'' is a member of ''map''?
-Echo
I wish I could help you out, sorry. I was wondering though, I noticed your map structure and was wondering how you got x, y and z to be a member of ''tile'' when ''tile'' is a member of ''map''?
-Echo
January 08, 2002 10:43 AM
There is a pretty simple way that I know of... just use colors. Draw each polygon to an off-screen buffer as a different color.. then when you click, get the color of the off-screen buffer, and then you know which polygon it was.. that''s a simple way.. uses a bit more GPU power.. but, is reliable (provided you''re working in true color, or seperate your colors a little bit) and pretty quick since you aren''t texturing or lighting or anything.
Billy
Billy
January 08, 2002 10:46 AM
Oh, and i''m assuming his structures are setup like so:
struct Vertex_S
{
float x,y,z;
};
struct Map_S
{
Vertex_S Tiles[32][32]; //Or whatever number
};
Map_S Map;
Billy
struct Vertex_S
{
float x,y,z;
};
struct Map_S
{
Vertex_S Tiles[32][32]; //Or whatever number
};
Map_S Map;
Billy
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement