User talk:Almar Joling/Journal

From GPWiki

Files:GUITutorial_warn.gif The Game Programming Wiki has moved! Files:GUITutorial_warn.gif

The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server.

However, the GPWiki forums are still active! Come say hello.

Nice screens, the water effect is impressive. Have you looked into using Picking for selection? I know OpenGL has it so I would think D3D would as well. If so why did you decide against it?

-Doug Sheets (on the road [Port Huron, Michigan], untrusted connection, so not logged in)


Well, I have picking in it. But isn't too precise when you are zoomed out a lot. Besides, assume a unit standing behind the bounding box of a cactus. The click will get the cactus, not the unit. :) Now that should be different, hopefully. :)

--Almar Joling 07:41, 19 Jan 2005 (EST)



You sure? As I recall picking returns a stack of object names (maybe this is OpenGL specific) that drew in the region. So your cactus would return a hit, and the closest one at that, but upon examing the name you'd know it was an unselectable object and go on to eventually find the unit. I could be wrong, I don't have my books with me and I haven't used picking in two years.

-DS


I've recently added GL picking to AMBER and yes, you do get a stack of object names. Also there are no bounding boxes involved. The list is of the polygons that cross the pick area ,(unless you draw bounding boxes youself instead of drawing the whole object.) I had used the color based picking method before that, it worked well until I dropped from 24bit to 16bit color.

Codehead 03:10, 20 Jan 2005 (EST)

Hmm, 16 bit colors. As long as you don use the alpha chan, things should go fine, since that's just 16 bit..? :) Hm. something I'd better make sure, so it does not give me a suprise someday :)

--Almar Joling 06:55, 22 Jan 2005 (EST)


The problem I had was down to the fact that I was using an incrementing color value for each selection object. ie Obj 1 RGB(0,0,0), Obj 2 RGB(1,0,0), Obj 3 RGB(2,0,0) ...... Obj 256 RGB(255,0,0). In 32/24 bit modes, getting the color under the mouse pointer returns a RGB values with a range of 0-255, with 16bit your RGBs only have a range of 32 values. This is a problem with GL because you still specify the colors with either 0.0f - 1.0f values or 0-255 values, it's difficult to equate that to the return value. It not be a problem for DX and it may be possible to work around it in GL, but I found it easier to use GL_SELECTION.

Codehead 14:44, 22 Jan 2005 (EST)


hm. 32 max in 16 bit. strange :o. Anyway, I put up the rope selection code, check out the recent changes :).

--Almar Joling 15:06, 22 Jan 2005 (EST)

Nice work, I didn't explain that last bit very well. If you put your game into 16 mode and the selection works, you're home free and you can ignore my ramblings. :) Codehead 03:55, 23 Jan 2005 (EST)