Questions tagged [raycasting]

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

1193 questions
10
votes
1 answer

Three js raycasting OBJ

Hello! I ve got an three js and tried to use it with my project. The thing is - i needed to select my custom mesh loaded from OBJ file. I created simple raycaster, simple cube, and my model (which is cube also). The thing is - i can have cube…
user2021673
  • 113
  • 1
  • 8
10
votes
2 answers

threejs disable orbit camera while using transform control

I have a scene with multiple meshes, each one of them associated to a different transformControl; in order to select different objects, I'm using raycasting techniques. I'm also using an orbit camera in order to navigate the scene. Whenever I modify…
rastafermo
  • 408
  • 1
  • 5
  • 13
8
votes
1 answer

THREE.js Raycasting from a child camera to the scene

I am trying to raycast the mouse from my camera to do some hover and click events on meshes in my scene. My problem is, that my camera is currently the child object of another mesh (for easier camera movement/rotation) and now my raycasting doesn't…
Ben
  • 99
  • 5
8
votes
1 answer

JavaFX Moving 3D objects with mouse on a virtual plane

As I was creating my first 3D game in JavaFX - where you would be able to assemble ships from parts using the mouse. This presents a problem since JAVAFX seems to have no native metods that work for converting PerspectiveCamera screen 2D coordinates…
Moff Kalast
  • 1,024
  • 1
  • 12
  • 22
8
votes
2 answers

Why do I get bad performance with SDL2 and SDL_RenderCopy inside a double for loop over all pixels?

I am programming a raycasting game using SDL2. When drawing the floor, I need to call SDL_RenderCopy pixelwise. This leads to a bottleneck which drops the framerate below 10 fps. I am looking for performance boosts but can't seem to find…
Marius Anderie
  • 23
  • 1
  • 2
  • 12
8
votes
2 answers

3D Volume rendering and multiple point of view occlusion

I've a `W x H x D' volumetric data that is zero everywhere except for little spherical volumes containing 1. I have written the shader to extract the "intersection" of that 3D volume with a generic object made of vertices. Vertex shader varying vec3…
linello
  • 8,451
  • 18
  • 63
  • 109
8
votes
2 answers

Visualizing Raycaster

I am trying to detect an intersection by using a raycast. My current problem is that I am not sure about my raycast aiming into the desired direction. So my general question is: Is there a way to make a raycast visible? And if so: How is it done?…
7
votes
1 answer

Octree raycasting/raytracing - best ray/leaf intersection without recursion

Could anyone provide a short & sweet explanation (or suggest a good tutorial) on how to cast a ray against a voxel octree without recursion? I have a complex model baked into an octree, and I need to find the best/closest leaf that intersects a…
3Dave
  • 28,657
  • 18
  • 88
  • 151
7
votes
2 answers

Checking if vertex is visible in camera view and render or occluded

I'm dealing with a machine learning task and I'm trying to use blender to generate synthetic images as a training dataset for a neural network. To do this, I have to find the bounding box of the objects in the rendered image. My code, up to now, is…
7
votes
1 answer

How to implement 2D raycasting light effect in GLSL

This was originally asked by @sydd here. I was curious about it so I try to code it but It was closed/deleted before I could answer so here it is. Question: How to reproduce/implement this 2D ray casting lighting effect in GLSL? The effect itself…
Spektre
  • 49,595
  • 11
  • 110
  • 380
7
votes
3 answers

three.js 3d models as hyperlink

I'm trying to figure out a way to use a 3D model created with Three.js as a hyperlink. In other words, if I click on a cube (a THREE.CubeGeometry), I want another page to open. For instance, in this threejs.org example, how can I change it, so…
lisa
  • 73
  • 1
  • 1
  • 4
7
votes
2 answers

Raycasting engine rendering creating slight distortion increasing towards edges of screen

I'm developing a basic raycasting engine for HTML5 canvas, of the variety used in games like Wolfenstein 3D and Doom, as a learning exercise / hobby project. I've got to the point where I have walls rendering on the canvas with texture mapping,…
James Hill
  • 496
  • 5
  • 15
7
votes
5 answers

How to find where to cast a ray to avoid collision in Bullet?

Say we have an object at point A. It wants to find out if it can move to point B. It has limited velocity so it can only move step by step. It casts a ray at direction it is moving to. Ray collides with an object and we detect it. How to get a way…
myWallJSON
  • 9,110
  • 22
  • 78
  • 149
6
votes
1 answer

Convert path to polygon

I'm trying to figure if a point is in a SVG path using Python. The algorithm that I'll use is the raycasting algorithm. But for this algorithm i need to have the polygon sides, but all I have is the the pathdata for the svg path:
patrick
  • 6,533
  • 7
  • 45
  • 66
6
votes
1 answer

Why is the floor in my raycaster seemingly "misaligned"?

I have been working on a doom/wolfenstein style raycaster for a while now. I implemented the "floor raycasting" to the best of my ability, roughly following a well known raycaster tutorial. It almost works, but the floor tiles seem slightly bigger…
1
2
3
79 80