• Content count

  • Joined

  • Last visited

  • Days Won


JohnK last won the day on February 19

JohnK had the most liked content!

1 Follower

About JohnK

  • Rank
    Advanced Member

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    England, Buckinghamshire

Recent Profile Visitors

1,781 profile views
  1. I have questions about how do you generally know where the character is and what it is doing. I am imagining a a group of non connected platforms at different positions left to right and front to back at different heights. But lets simplify to just platforms left and right at the same height will ground below. The character is on a platform and can 1. Jump onto another platform, how do you know which platform it lands on? 2. The character falls of a platform. How do you know which one it fell off? 3. The character runs along the ground and jumps onto a platform. How do you know which platform it jumps on? You could do all this by checking for all platforms which intersects with the character. For me some sort of mapping system for character and platforms would work better. Answering my questions may lead you to an answer for yours.
  2. You say if the is is now was please ignore what follows Ignorance is bliss they say, so my lack of knowledge on things like DDS or transpilers makes the answers clear to me. The only platform for BJS is a browser, any browser. For example but as far as BJS goes
  3. intersectsMesh only works when the bounding boxes of the meshes intersect. This PG shows the bounding boxes and when the balloon changes color relative to the bounding boxes.
  4. Good to hear from you @Wingnut. Before writing my post I can across this paper that shows that the process can be automated, ie given a simple polygon (ie one with no intersecting sides) there is an efficient algorithm to triangulate it. It wasn't after much more than one sentence that I gave up reading it. There are probably non-efficient ways of doing it which I have some idea about and maybe give it a go sometime.
  5. In the SPS system all particles are part of a single mesh, so all are anchored to the centre of the built mesh. So to get the 'person' to walk you can just adjust the position of the mesh. Example PG Since particles are not meshes it is not possible to set a pivot for them nor is it possible to set a parent However you could take a bunch of simple meshes and give them all the same mesh as a parent, then any movement of the parent would move the children. The other way to consider is using bones and skeletons.
  6. Hi and welcome from me. If you are just working with your own custom shapes then you could build the caps manually from the data you are using. When you google 'triangulation of polygons' the algorithms for concave polygons are complex and not easily read. For your data label the vertices of the shape to be extruded and split into triangles, as for example in the diagram below. You can then place the triangles 0, 1, 4 1, 3, 4, etc into the indices array NOTE order of indices consistently clockwise for all triangles and the create your own custom meshes for the caps. Example Should you then want to you could merge the extrusion and the two caps.
  7. Have you had a look at facetData? Each facet is a basic triangle that makes up a mesh. It allows you to get local position data Jerome started it here as a way of bouncing small particles off a mesh and it needs version 3.0-alpha, which the playground uses or for external use you can get it here. I did some work on using it to find where two meshes intersected but had never heard of Tomas Möller's Triangle-Triangle Overlap Test. My playground for this is at with words of warning in the posting. You will probably be better starting from scratch. Good luck in your project.
  8. Needs a really really like it button😁
  9. Still do not know very much about canvas2D but simplified the example - Track 3D Scene Nodes with WorldSpaceCanvas -- from this tutorial to make this PG for an HUD. Have a play around. Not so much forgot as avoided
  10. Hi and welcome, hope you have a good time with BJS and of course CSG and the forum. Is this anything like what you are after?
  11. (1) I hope you read more than the first paragraph. (2) You did not specify in your original question the camera had to be moved using a mouse. (3) A mixture of the mapping method with your own custom mouse control could work. (4) You could try the onPick triggers on a mesh that is parent to a camera to achieve (3). (5) Wait for a better answer.
  12. Maybe this helps (or maybe not) In the playground below I can control the camera with the mouse or the car with the keys but not both at the same times. This is because (I think) the car use actionManager and the camera uses the default BJS system. What may be helpful is that I use A to turn left D to turn right SPACE to accelerate and you can turn and accelerate at the same time. To do multi-keypresses I use a key map to hold the keys currently down see lines 137 to 151. Lines 178, 192 and 210 produce the actions if SPACE, A and/or D are down respectively. Note : Click on the car before pressing any keys. Now in the next playground I have added the key Z to allow me to rotate the camera, which I can now do at the same time as accelerating the car ( new lines 178 to 180). While I was using an arcRotateCamera I changed the alpha. Of course if you are using a different type of camera then you will need to check what properties and methods are available for updating. You might also need to detachControl of the camera while doing this. If you think it is worth a try then just experiment with a simple PG.
  13. Along way from perfect but this forms shapes from given numbers of SPS particles and tries to take into account that because of rotation speed two particles may have collided between frames but when checked are not intersecting in either of the frames. Still a work in progress. Which do you think looks better (1) or (2) ? (1) (2) How about (3) and (4) (3) checks for potential collisions before they could happen and adjusts velocity (4) checks for potential collisions after they could have happened and adjusts velocity
  14. Hi and a welcome from me to the forum and BJS. A powerful way of displaying data within BJS is using canvas2D (not the canvas element of HTML but a method within BJS to add 2D information). You can start reading about it here Whilst I have never used it myself and could not answer questions about it there are many people on the forum who could. Good luck with your project.
  15. Watching the development of the terrain with impressed interest.