Custom controller Away3d interaction

Software: Away3D 4.x

derrii, Newbie
Posted: 23 August 2012 09:15 AM   Total Posts: 2

Hello everyone,

I’m developing arduino project with Away3d interactive visualization. Currently Away3d part looks like this:
- there is like 300 cubes in the space
- I’m using MouseEvent3d which does some transformations when MOUSE_OVER is fired

However, from my custom arduino controller I can only grab X and Y coordinates, but in as3 you can’t move mouse pointer to given position, so I won’t be able to use MouseEvent3d to project x/y screen coordinates to stage3d (and Z value of each cube differs of course)

My question is - how can I check this type of “collision” - functionality is perfectly the same as in case of mouse pointer, but it’s not a mouse pointer wink just x/y values.

I’m in hurry due to making visual art project, so I will really appreaciate all your help.

Regards,
Adam

   

derrii, Newbie
Posted: 23 August 2012 10:17 AM   Total Posts: 2   [ # 1 ]

Well, I’ve found really dirty way of doing this by modifing View3D class and adding getters and setters for mouseX and mouseY:

for example:

protected var _mouseX:Number = 250;
protected var _mouseY:Number = 250;

...

override public function get mouseX():Number { return _mouseX }

etc.


If there is a cleanier solution, please let me know.

   

Avatar
theMightyAtom, Sr. Member
Posted: 23 August 2012 10:45 AM   Total Posts: 669   [ # 2 ]

I believe the RaycasterPicker, or shaderPicker are what you need, if you want to input a coordinate (x,y) and get an object back, without using the mouse.
https://github.com/away3d/away3d-core-fp11/blob/master/src/away3d/core/pick/RaycastPicker.as

https://github.com/away3d/away3d-core-fp11/blob/master/src/away3d/core/pick/ShaderPicker.as

Good Luck!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X