c3d.interact
The interact module allows you to get things from the 3D scene from screen coordinates. For example you can find what object was clicked by just inputed the screen click coordinates.
enable(enable) | allows you to disable and enable updating the screen -> scene information table. |
---|---|
get_fragment(x, y) | returns the fragment data used when drawing the given pixel. |
get_triangle(x, y) | returns a triangle object at the given screen coordinates. |
get_object(x, y) | returns a scene object at the given screen coordinates. |
get_triangle_pixel(x, y) | returns a triangle object at the given screen coordinates. |
get_object_pixel(x, y) | returns a scene object at the given screen coordinates. |
get_fragment_pixel(x, y) | returns the fragment data used when drawing the given pixel. |
- enable(enable)Source
allows you to disable and enable updating the screen -> scene information table.
Parameters
- enable boolean the state to set the updating to.
- get_fragment(x, y)Source
returns the fragment data used when drawing the given pixel. Only works of instantiate_frag is enabled on the object. (translates from drawing char coord to pixel internally)
Parameters
- x number the
x
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback - y number the
y
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback
Returns
- fragment the fragment passed to the fragment shader when this pixel was being drawn
- x number the
- get_triangle(x, y)Source
returns a triangle object at the given screen coordinates. (translates from drawing char coord to pixel internally)
Parameters
- x number the
x
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback - y number the
y
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback
Returns
- triangle the triangle table object at the given screen coordinates
- x number the
- get_object(x, y)Source
returns a scene object at the given screen coordinates. (translates from drawing char coord to pixel internally)
Parameters
- x number the
x
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback - y number the
y
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback
Returns
- scene_object the scene object at the given screen coordinates
- x number the
- get_triangle_pixel(x, y)Source
returns a triangle object at the given screen coordinates. (does not translate. ideal for things like CraftOS-pc graphicsm mode)
Parameters
- x number the
x
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback - y number the
y
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback
Returns
- triangle the triangle table object at the given screen coordinates
- x number the
- get_object_pixel(x, y)Source
returns a scene object at the given screen coordinates. (does not translate. ideal for things like CraftOS-pc graphicsm mode)
Parameters
- x number the
x
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback - y number the
y
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback
Returns
- scene_object the scene object at the given screen coordinates
- x number the
- get_fragment_pixel(x, y)Source
returns the fragment data used when drawing the given pixel. Only works of instantiate_frag is enabled on the object. (does not translate. ideal for things like CraftOS-pc graphicsm mode)
Parameters
- x number the
x
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback - y number the
y
screen coordinate of the character block. Taken for example from mouse_click event or the mousepressed callback
Returns
- fragment the fragment passed to the fragment shader when this pixel was being drawn
- x number the