1

How would I go about detecting whether or not a ray sent from where the user touches the screen

Ray ray = cam.getPickRay(touchX, touchY) where cam is a perspective camera

intersects with a polygonal model. My current method of clicking on cubes doesn't work in certain cases shown here: http://screencloud.net/v/7z86 as it isnt checking for the model's unique polygon

im using shape = loader.loadModel(Gdx.files.internal(model)); to declare my shapes and shapeInst = new ModelInstance(shape); to declare my ModelInstance

As you can see in the picture above my models are not perfect squares but rather unique polygons.

TL;DR what is the correct method of ray tracing and getting intersection detection on 3d models

Olivier Moindrot
  • 27,908
  • 11
  • 92
  • 91

0 Answers0