• ### Popular Now

• 14
• 15
• 10
• 10
• 9

#### Archived

This topic is now archived and is closed to further replies.

# making interface

This topic is 5871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Can anyone please point me to a site that shows how I might develop a simple Ogl interface to draw lines, polygons, etc. I mean, with buttons to press to choose a rectangle or circle, then draw it in the other viewport?

##### Share on other sites
I dunno, but you can make I use a real stupid method, I just used texturized quads, then place another quad on it with a different texture. Then I just use picking and voila it works.

##### Share on other sites
I dunno, but you can make I use a real stupid method, I just used texturized quads, then place another quad on it with a different texture. Then I just use picking and voila it works.

##### Share on other sites
or you could use colored quads for buttons, with 2d-texture text drawn on them, and use a 2D bsp for detecting collisions between the mouse and the buttons...

##### Share on other sites
what''s a 2D bsp?

##### Share on other sites
Why the hell would you want to use 2D bsp? has everyone decided.. "Ooo... John Carmack uses BSP trees... so let's all go out and use them to decide what i'm gonna have for breakfast!"?

Arrgghh! it's 2D! 2D! you don't need a bsp tree for that! it complicates matters infinitly!
Sure you could use it if you are so inclined to BSP trees... i never could get them to work properly and use Octrees instead! so there!

Anyway....
A simple way would be just to use Bounds Checking... ie. get mouse x and y co-ords and check to see if it's in the bounds of the object you want.. eg...
  mx=mouse x;my=moues y;max_x=maximum x bounds of object;min_x=minimum x bounds of object;max_y=maximum y bounds of object;min_y=minimum y bounds of object;if (mx < max_x and mx > min_x and my < max_y and my > min_y) mouseclickbutton();

Seems pretty Simple to me..

btw: no offence Mr. "Anonymouse Poster" about the bsp tree thing.. they sure are useful for some stuff.. but i think it's time to invent a more effecient manner to do stuff then "BSP" tree....

I bet you are saying right now...
"But he has to iterate through every object to get what he wants.."
yes.. that's true.. but unless he has a billion bjects on the screen, surely he can afford the cost of *NOT* having the overhead of a BSP tree?

Edited by - Spikeles on February 23, 2002 11:08:55 AM

##### Share on other sites
Sorry "Anomymus Poster" I shouldnt have said any of that... i had at think about it and i do belive a 2D bsp tree might actually be quite usefull for more advanced apllications of interfaces... again i apologize for my rash words...