Advertisement

triselect woes

Started by September 21, 2001 04:49 PM
2 comments, last by KeithW 23 years, 5 months ago
I have downloaded the triselect demo that allows the user to click on various triangles in 3D space as they are projected onto the 2D screen. I would like to integrate this code into my program so I can select various 3D objects by clicking on them in the window. I am having some serious problems. For starters, with the two lines that first enable PROJECTION mode and then disable it left in, my entire program goes whack. It shoudn''t. Since the DoSelect code is on its own separate pushed matrix, it should effect drawing operations elsewhere in the program, but it does. Basically, as soon as I click the mouse and this code is run and consequently the mode is switched and then switched back to MODELVIEW, the drawing in the window goes blank (actually it''s all background). I''m sure if the objects are lost, or if the camera has been moved or something, but it''s totally screwed up. The second problem, also very serious, is that the selection routines simply don''t work. To put it plainly, the selection stack is empty. What gives?
bump
Advertisement
It sounds to me like once you start selection, you do not leave it. This prevents objects from that point on being drawn.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
No, that definitely wasn''t the problem. I was definitely reinstating RENDER mode. I have gotten it working, although I''m sort of at a loss for what I was doing wrong before. I think I was mixing up perspective in some places (main display) and ortho in others (in the select routine). Thus, the images didn''t line up on top of each other.

As to the select routine screwing up the main image, I have discovered that contrary to all the demos on the net, I have to explicitly call Reshape after the selection routine to get normal display routine back to normal. I''m not sure what the demos don''t require this. Perhaps it has something to do with the fact that all the demos use orth and I am using perspective. Who knows?

This topic is closed to new replies.

Advertisement