Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

291
Vistas
Raycasting mouse position to draw on 3D mesh

I want to draw on a 3D object, and the way I do it is to raycast hits from the mouse position and paint the closest 3D vertex to that hit.

However, when I am moving the mouse really fast, the hits are not registering, and there are big gaps in my drawing:

Missing drawing

What could be the issue?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The issue is pretty clearly that you are not sampling inputs quickly enough for your given painting strategy. This may be because the time between samples is unusually slow (perhaps because your raycasts are taking too much time) or because the speed of the mouse simply exceeds any reasonable sampling rate. This is a fundamental flaw in your painting strategy, which is to paint one vertex for each input sample.

A more robust approach would involve some sort of interpolation. Here are two approaches that come to mind:

  1. Interpolate the input samples. I.e., if one mouse input is sampled at coordinates (x1, y1) and the next input is sampled at (x2, y2), you could add imaginary samples along the line segment from (x1, y1) to (x2, y2) and raycast those as well. If your raycasts are costly, this may not be a performant option. Also you would have to somehow determine a good number of extra points to introduce.
  2. Interpolate along the mesh. In this case, you raycast two consecutive input samples to find two corresponding vertices on the mesh. Then you also paint all vertices along a path between those two vertices. The shortest path seems reasonable, but perhaps there are better strategies for your case.
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda