Jump to content
  • Advertisement

Archived

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

KeithW

triselect woes

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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!"

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!