Jump to content

distraub

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by distraub

  1. @rjeThat is part of the playground system though, not part of this particular playgrounds code.
  2. It looks like the raising CPU issue may have been a heat issue on this machine. I am still not sure what from that playground would drive it so hard. Do you have any optimization recommendations to curb cpu usage on that playground?
  3. I am getting pretty high CPU usage in this playground and can't figure out exactly why. When I profile most of the time is spent in _renderForCamera https://playground.babylonjs.com/#HRYQ1L#20 I was getting 40-42% cpu, but leaving it for a little while the cpu hits 100%+ Any ideas on what I can do would be apperciated.
  4. Thank you @Amarth2Estel This does solve my issue, if I use multiPickWithRay and then check for the id of my mesh, then it works as expected. I was hoping intersectsMesh would work the same way. Here is an example https://www.babylonjs-playground.com/#KNB069#3 If you intersectsMesh with those coordinates it seems to use the other end, which almost looks like it is shooting the ray from the target to the source and using that picked point.
  5. I am hoping someone can take a look at this, and let me know if I am using it wrong. I have 2 spheres that I have attached Rays to, they are both shooting at a target, and there is a large sphere in the way, called earth. When I change the position of the spheres, the pickedPoint that is returned by hitInfo on the Ray.intersectsMesh function seems to be giving me an incorrect Picked Point if my source has a negative Y position. The "source" ray is just fine, but the "alternate" ray seems to be getting a picked point that is on the wrong side of the earth. Any help would be appreciated, I put this in a playground so you can see what I mean. https://www.babylonjs-playground.com/#KNB069
  6. Wow Jerome Sorry I didn't realize you came back and replied, you are awesome
  7. I was able to reproduce it in a PG https://www.babylonjs-playground.com/#0D3P8C Here is a version on stable that doesn't have a problem https://www.babylonjs-playground.com/indexstable#8HS4GZ
  8. I seem to have this same issue on the alpha preview builds. But do not experience the issue on 3.0 stable. return t.prototype.attachControl = function(t, i) { var r, n, o, s = this, a = this.camera.getEngine(), l = 0; this._pointerInput = function(a, h) { var c = a.event; if (a.type === e.PointerEventTypes.POINTERMOVE || -1 !== s.buttons.indexOf(c.button)) if (a.type === e.PointerEventTypes.POINTERDOWN) { try { c.srcElement.setPointerCapture(c.pointerId) } catch (e) {} s._isPanClick = c.button === s.camera._panningMouseButton, I am receiving : TypeError: Cannot read property 'getEngine' of null on the this.camera.getEngine() call It is when I detach the camera on pointerDown, then attach it on pointerUp I am sticking with 3.0 stable for now.
  9. Well thought I figured it out but it doesn't exactly work for all points, sort of spirals on some. https://www.babylonjs-playground.com/#2I0VXX#39
  10. And I finally figured it out. https://www.babylonjs-playground.com/#2I0VXX#34
  11. Hey guys, I have been trying to do this for awhile, and feel like I am almost there. I had been using Bezier Curves but it wasn't quite doing what I needed. I need to draw an arc made with lines between 2 points on the sphere, following the curve of the sphere. I think I am close on this playground but some of my math isn't right in the drawArcFromPoints function Anyone think they can take a look and tell me where I am going wrong? https://www.babylonjs-playground.com/#2I0VXX#28
  12. Here is an idea of what I am going for, this is a crude way to do this, and it almost works. But I am sure there is a better way. If anyone can take a look and help, I would be very grateful. https://www.babylonjs-playground.com/#2I0VXX#8 I am getting the arc based on using a mesh, rotating it with lookAt looking at the center of the earth, then using that angle to calculate control points for the arc. I was using a quadraticBezier first but switched to a Cubic Bezier because I was clipping at different locations. I am still clipping when at different places, have to figure out the right height for the control points I am sure this can all be accomplished with a great circle formula but my trig just isn't up to par for the task.
  13. Good to know, I think I had that backwards in my mind.
  14. My next question would be how can I easily get the intersection point between my line and the bounding sphere? I have a wireframe mesh where I would like my bounding sphere in this playground. I would like to pick up the Vector 3 of where the line touches the face of the bounding sphere first. https://www.babylonjs-playground.com/#1NZLA9#7
  15. hi @Wingnut thanks for the reply! What I am looking for isn't really a weapon, or a spacecraft, more of a broadcast point to a spot on the planet, visually showing the communication. So ideally it would be an arc to the planet first, since it just looks cool, but then it would catch and orbit the planet and stop on a particular lat/long. I was thinking of using a bounding sphere around the planet, catch the intersection point on the sphere from the first arc, then finish it by following the arc of the sphere with a new curve. I am going to give that a try today, but am very new to Babylon, so am not quite sure of all the details and the math to make it happen.
  16. Thank you, I really wasn't only looking to put the line in a different rendering group . I would love it to contour the planet, but am not sure the best way to go about that. I will have multiple points from space hitting multiple spots on the planet. and I wanted to make sure you could see them all individually. Initially I thought I could bring them all to a point and then have them wrap around the planet to hit their destination, but then you wouldn't be able to tell which object was connecting to the planet.
  17. I am hoping you guys can help me out. What I am trying to accomplish is to hit a point on a planet with a curved line from space. I would like it to wrap around the planet if the point is on the back, and not clip. Here is a playground to give you an idea of what I am trying to do. https://www.babylonjs-playground.com/#1NZLA9#5 Ideally I should be able to hit any point on the globe without clipping it, I am just not sure exactly what the math would look like to calculate those angles dynamically.
×
×
  • Create New...