Questions tagged [raycasting]

A rendering technique to create a 3D perspective in a 2D map

1193 questions
5
votes
2 answers

Three.js Raycaster not detecting scene mesh

I am using three.js r67 in Chrome Version 35.0.1916.153 m I am attempting to intersect some custom meshes that I have created in my scene. The raycaster does not appear to be registering the meshes although they exist within scene.children . Mesh…
James Milner
  • 879
  • 2
  • 11
  • 16
5
votes
1 answer

How to get other 3D objects within a radius of a position in three.js

I have a 3D scene in three.js in which I need to get an array of objects that are within X range of a source object. At the moment, the example I'm using is utilizing raycasting inside of a for loop that iterates an array of "collidable objects"…
Brian
  • 3,013
  • 19
  • 27
5
votes
1 answer

Three.js Raycaster on WebWorker

I am using Three.js Raycaster method in my web based car race game. But due to the heavy computations it is consuming a lot of CPU Cycles hence leading to a drop in fps. I am thinking of exporting the RayCaster method of Three.js on WebWorker. Can…
5
votes
2 answers

Remove Box collider of object in unity 3d

Here is my code in Update function. The object has a box collider. if (Input.GetMouseButtonDown(0)) { Ray ray = camera.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast (ray, out hit3, 400.0F)) { wName =…
Sona Rijesh
  • 1,041
  • 7
  • 32
  • 62
4
votes
1 answer

Is there a raycasting library in C++ that is simple and open source?

I'm looking for a library that will let me cast a ray into a scene model (it happens to be a terrain model in our case) and return the point of intersection in the scene. It does not have to be super-efficient (although I'd rather it not be…
Alton Patrick
  • 235
  • 1
  • 4
  • 10
4
votes
2 answers

Unity Physics.Raycast with LayerMask does not detect object on layer. Used bitshifting, tried inverting layer, still nothing works

novice to intermediate Unity developer here. I've been hitting a pretty significant roadblock the past ~2 days concerning the raycast detection of objects with specific layers. I've been researching this issue quite a lot, and all the solutions I've…
4
votes
1 answer

How to use Raycast methods in RealityKit?

There are three ways about Detecting Intersections in RealityKit framework, but I don't know how to use it in my project. 1. func raycast(origin: SIMD3, direction: SIMD3, length: Float, query:…
zhou junhua
  • 462
  • 1
  • 4
  • 12
4
votes
1 answer

How to use vtkOBBTree and IntersectWithLine to find the intersection of a line and a PolyDataFilter in python using vtk?

I have an oriented cylinder generated with vtkCylinderSource and some transformations are applied on it to get the orientation that i want. Here is the code for creating this oriented-cylinder: def cylinder_object(startPoint, endPoint, radius,…
shahriar
  • 362
  • 4
  • 17
4
votes
1 answer

Detect obstacle and block players movement with raycast

I'm new in Unity3D and I have a problem with collision detection. I want to return true if i hit the obstacle by raycast and block movement in this direction. It works good when im in front of the obstacle face to face. When i'm changing direction…
Gleuq
  • 43
  • 3
4
votes
2 answers

Unity shotgun making

so I'm a bit new to C# with random math and I learned how to make a rifle, pistol, etc. But I want to learn how to make a shotgun with raycast, not with projectile. With raycast's I tired to do more then 1 raycast but didn't know how to make them…
4
votes
2 answers

How do I block ARCore model placement when the user touches a GameObject?

Disclaimer: I'm pretty new to Unity3D and ARCore, so please bear with me. I'm using ARCore in Unity3D to create a scene where the user can select models in a ScrollView on the screen and place them using Google's ARCore framework. So far I have it…
Daevin
  • 778
  • 3
  • 14
  • 31
4
votes
0 answers

three.js mouse offset with raycasting and intersecting

I've just started graphics programming with Three.js and I am trying to get a mouseover interaction with some shapes for a project I am working on. I have tried some of the other answers from similar questions but I still cannot get the mouse to…
LegacyBear
  • 77
  • 5
4
votes
2 answers

Using Layers and Bitmask with Raycast in Unity

Unity's Raycast functions has a parameter you could use to raycast to a particular GameObject. You can also use that parameter to ignore particular GameObject. For exmple the Raycast function: public static bool Raycast(Vector3 origin, Vector3…
Programmer
  • 121,791
  • 22
  • 236
  • 328
4
votes
1 answer

Intersecting an isometric cube in Obelisk.js when mouse pointer intersects

I am using obelisk.js, which does not have a native way ( to my knowledge) of intersecting or raycasting for mouse picking, so I am trying to make my own methods, but I am not sure how to proceed. Here's the code for a basic pen with a mouseover ( I…
Keno
  • 3,694
  • 2
  • 21
  • 40
4
votes
1 answer

GameMaker 2D Visibility

I would like to implement in GameMaker exactly the same thing as in this article: http://www.redblobgames.com/articles/visibility/. The code for it is available there in different languages, but I can't figure out how to effectively port it to GML.…