getSceneNodeFromScreenCoordinatesBB problem

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

getSceneNodeFromScreenCoordinatesBB problem

Post by saigumi »

I just started playing with the selector using the mouse and I've hit on a problem. The point of selection seems to be slipping outward as you get further from the center of the screen. So, when I click, it selects the object that is 1 closer to the center than itself.

I'm going to try to pull out the code that I am using into a test example to make it easier to see, but it's going to take a little bit.

Strangely, it looks like it's only affecting my meshes as the testSceneNodes work as expected.
Crud, how do I do this again?
qwe
Posts: 112
Joined: Sun Dec 28, 2003 12:54 am
Location: Oregon, USA

Post by qwe »

i have NO idea how the code works, but could it have something to do with the "stretching" you see around the edges of the screen that makes it look more real?
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Not really, I'm using an ortho view so there is no stretching.

But I'm almost wondering if it has anything to do with some of the problems I ran into earlier setting the ortho view and the milkshape models being inverted. I have been playing with it and it's definitely related to the position of the object as the place that would need to be clicked to select an object is related to the quadrant of the screen it is in.

if the object is in the top left, I need to click past the top left of the object. Top Right = Top Right. etc...
Crud, how do I do this again?
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Post by rt »

have you tried calling the functions one by one to see where the error is introduced? for example try calling getSceneNodeFromRayBB() and supply a ray which you know should intersect the node.

does the problem still exist if you use getCollisionPoint() to determine if a ray intersects the node?
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

I'm nto sure, but I think it may have to do with how the ray for the test is constructed. Irrlicht constructs the ray from the camera, which makes point and click of3D objects hard because the ray is not going straight in from the mouse cursor. That's what i think anyway, I'm not sure.
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

This is a common problem.

getSceneNodeFromScreenCoordinatesBB returns as result
getSceneNodeFromRayBB function /not work with ortho cameras well/.

If you use last function, problem still exist.

Have you seen this thread?

http://irrlicht.sourceforge.net/phpBB2/ ... 96&start=0

I wrote something about.
Post Reply