Questions tagged [raycasting]

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

1193 questions
-1
votes
1 answer

How can I use raycasting to create a ray based on origin and direction?

Imagine I have a block in the middle of a 3-dimensional room. I know the position of that block, and I know the direction of the ray I want to cast. How would the direction be represented in data? Degrees? Vectors? Magnitude? I honestly have no…
Andrew
  • 15
  • 6
-1
votes
1 answer

Get orientation of an Object3d child

Ok, here is the problem: I am using a PerspectiveCamera as a child of an Object3d to chase it. ... player.add(backCamera); backCamera.position.set(0, 10, -80); backCamera.lookAt(player.position); ... Now i am trying to use a Raycaster to find the…
Jiloc
  • 3,338
  • 3
  • 24
  • 38
-1
votes
1 answer

Unity Selecting sub-model

I have a model of human body which consists of hundreds of sub-models (muscles). I want to click on the sub-model and get its name. Basically, I know two possible solutions. To create stupid script OnButtonDown for every single sub-model.. which is…
Michal Krča
  • 149
  • 3
  • 15
-1
votes
1 answer

Isuue in drawing arrow from one mesh object to surface of another mesh object

I am trying to draw an arrow from one mesh object to another mesh object. But if I directly use their postions and send as arguments in the Arrow Helper then the arrow is going inside the object because the position of an object means the centre of…
-1
votes
1 answer

Using raycast how to make player run between two colliders without colliding in unity3d?

I am trying to let the player run on a path between two colliders on either sides using the accelerometer. I want my player to come back to the center after colliding with the sidewalls when I tilt the device. I have tried using Raycast, but I am…
-1
votes
1 answer

Unity - Car AI Avoiding obstacle

sorry for asking too often. I have a problem on Andrew Gotow's Car AI. The Problem is The AI did not avoid player / car in front of them or they just go ahead and hit the player / car in front of them. When hit a car or any obstacle, They stop…
-1
votes
2 answers

cant understand raycasting math from tut code

forgive me in advance for my ignorance in math . i haven't found any sources that would help me else i wouldn't have opened this topic i want to create a simple ray-casting engine in javascript, i handled the tile system it wasn't to hard and i had…
rolen
  • 9
  • 2
  • 8
-2
votes
1 answer

Godot newbie puzzled by the hierarchy of nodes in regard to raycasting

I'm new to Godot, but not to OOP. I'm puzzled by something, which I guess goes to my lack of understanding of node hierarchies in general: If raytracing intersection looks for collision objects; how come, then, it yields a parent node of the…
rantash68
  • 47
  • 1
  • 6
-2
votes
1 answer

why does my raycast sometimes shoot in the wrong direction?

I'm trying to shoot a raycast from a gameobject at the front of a gun that is being carried by an XR hand. The gun shoots fine most of the time, but sometimes, for some reasons beyond my fragile little minds comprehension, it shoots in the wrong…
-2
votes
1 answer

How do i access the steeringTarget after the current steeringTarget?

I'm raycasting a ray from the agent in the direction of the steeringTarget with a specific length. If it reaches the steeringTarget i want to cast another ray with the remaing length towards the next one. I'm doing this to predict the position of…
Alex
  • 1
  • 3
-2
votes
1 answer

Getting objects name by pointing on it Unity Raycast

I want to print name of object witch i am pointing on (with crosshari). I wrote some scripts witch allows me to highlight object by looking at it (included below). Can you tel me how can i add a line of code doind this (print name of object witch i…
-2
votes
1 answer

Shaped Ray Cast for C++

I'm looking for a (preferably free) lib for the following: I want to do a Trace Ray through my scene, but not for a single starting point, but rather a starting shape. So instead of having the origin being a point and the trace a line, I want the…
-2
votes
1 answer

Raycast point returns multiple values without moving

RaycastHit hit; if(Physics.Raycast(character.cam.transform.position, character.cam.lookDir, out hit)){ Debug.Log(hit.point); } this returns 3 to 4 different values, one a frame, without moving or rotating the camera
-2
votes
1 answer

Understanding a raycast method

For the purpose of my school, I am learning how to do a raycast in C. Based on this tutorial I found http://permadi.com/1996/05/ray-casting-tutorial-7/, the author explains his method to find deltaX and deltaY to check whenever there is a wall at a…
Quentin Laillé
  • 125
  • 1
  • 12
-2
votes
1 answer

Three.js Coordinate system confusing

I have a basic question regarding coordinate system in Three.js. I have a spherical geometry of radius 500 and a camera placed at (0,0,0). I am using raycasting to find the intersection on the spherical surface. I can see in the intersect object…
TA-
  • 63
  • 5
1 2 3
79
80