We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › help noob reconciling sketch in 3d, 2d mouse event
Page Index Toggle Pages: 1
help noob reconciling sketch in 3d, 2d mouse event (Read 822 times)
help noob reconciling sketch in 3d, 2d mouse event
Oct 8th, 2008, 12:31am
 
hi

this is actually a manifold question that has to do with my lack of understanding of 3d scenes in processing. I have a network graph that is actually 2d but in order to pan, zoom and do other 'camera' functions I needed to move into 3d space.

Now that I am in 3d space and I have all my nice camera operations sort of going I have lost the nice interactions I had with the graph in question IE clicking on nodes in the graph previously highlighted them, you could drag them etc etc. Now none of that is possible. My hunch says that the part of the code that checks whether the mouse is "on" the node needs to be tweaked because presumably what I am seeing is only some sort of representation...but the bottom line is , I have no idea how to sort this out.

Related, I believe, to this issue, is my desire and inability to draw a nice gui 2d overlay despite following simple instructions in other threads...anyways, i guess one thing at a time.

To make matters worse, I can't export due to some processing bug which apparently is fixed for the next release...

thanks for your help, in advance.
g
Re: help noob reconciling sketch in 3d, 2d mouse e
Reply #1 - Oct 13th, 2008, 6:40pm
 
Quote:
Now that I am in 3d space and I have all my nice camera operations sort of going I have lost the nice interactions I had with the graph in question IE clicking on nodes in the graph previously highlighted them, you could drag them etc etc.


You can do such things in 3D but it's obviously more complicated than in 2D. See the hacks section and the related picking tutorials :
http://processing.org/hacks/doku.php?id=hacks:picking
Re: help noob reconciling sketch in 3d, 2d mouse e
Reply #2 - Nov 15th, 2008, 10:03pm
 
ok. trying to get your hack going. I understand it in principle but some of the minor details are tripping me up

I've commented out what I have tried but you can see the sketch I'm trying to apply it to here

upsdn.ca/processing/GraphLayout_animals_rehash3D02/applet/

I had trouble with where I was swapping out the for loop through your 'boxes' for my nodes...something about
"The type of the expression must be an array type but it resolved to ArrayList"

as you can probably tell I get confused about how to manage collections and arrays. I typically try one thing and if that fails I move onto a different approach eg length vs size() for determining the number of items...

from what I can tell I have a series of Nodes placed into an ArrayList and I need to convert back to a Node array or Node[]...how would one do that?


any help you could provide would really be appreciated
Re: help noob reconciling sketch in 3d, 2d mouse e
Reply #3 - Nov 16th, 2008, 3:07am
 
ok. I made a bit of headway concerning arraylists i think and it now compiles. perhaps there are too many mouse events controlling camera movement - BUT the bigger issue is wrapping my head around the fact that I am choosing a node via its buffer id color but then I have an arraylist of nodes with places in that list that don't necessarily correspond with the node that the color id refers to...just explaining what I think the problem with is giving me a hard time Sad
Page Index Toggle Pages: 1