Richard C

Members
  • Content Count

    103
  • Joined

  • Last visited

  • Days Won

    1

Richard C last won the day on January 15 2017

Richard C had the most liked content!

About Richard C

  • Rank
    Advanced Member

Profile Information

  • Location
    Oxford, England

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks for your replies. I will continue the learning curve. Richard C
  2. Hi Ivan Thanks for the prompt reply. The web-page is laid out as a responsive grid (css-grid) as per the attached image. I would like a different pixi canvas in the three grid cells as shown. Each cell is identified by the usual css case and ID. Any further help would be appreciated. I don't know hopw to put a canvas/stage in each cell Many thanks Richadr C
  3. I'm new to pixi.js and struggling to find a solution in the pixi documents. I want to use a pixi stage on a canvas within a specific cell in css-grid. In fact, I should like to use different pixi effects in a number of cells in the grid which makes the entire web-page. Is this possible? All examples seem to add a canvas to the body tag which is not what I need obviously. I have researched previous questions in here but all seem to refer to earlier versions of pixi.js. A succint answer would be very much appreciated. Many thanks Richard C
  4. I am using CreatandStartAnimation to change the diffuse colour of an object (created in Blender). It works as it should, but it appears the change isn't permanent. If I console.log the diffuse color of the object before and then after the animation the object's diffusecolor is the same. Am I right ? Thanks Richard C ***** I was not thinking it through The post animation console.log was running before the animation had finished ! Console.log within a Timeout function ensured the log run after the animation. The answer to my question is that an animation does change the diffuseColour of an object !!
  5. brianzinn - your suggested solution set me off on the right road and I now have the sub doing what I need. Many thanks to you and Wingnut R
  6. brianzinn and Wingnut Thanks both - playing with both - I'll let you know Cheers
  7. Hi Wingnut Yes in real-life the sub does allow for powered ascent/descent by use of vertical thrusters BUT these are not used to 'go faster' but to control ascent rate in the main - the sub always has positive bouyancy and without pilot intervention, would float to the surface. Reducing water pressure as the sub ascends causes air to expand which in turn creates even more bouyancy and the sub 'rushes' to the surface way beyond safe diving limits. As a point of interest - we actually allowed the sub to actually do that. The pilot got out of the sub at 15m and just let it ascend of in own accord. The sub actually left the water completely at the surface - a Red October moment for sure . The 900kg sub shot above the water by some 300cm. If that were allowed to happen in real life the passengers would be the whale fodder cos they would be dead as a result of extreme decompression sickness - the lungs could literally blow out of the body. So the vertical thrusters are used to control the rate of descent. For the same reason. they are used to maintain a fixed depth whilst moving horizontally when submerged. The purpose for the ease-in / easeout functions are two fold : 1. mimick what the pilot strives to do to make a slow start and gradually move to operating speed 2. to mimick the effect of the water / currents As I said earlier - the EaseIn formula works well - I just need the negative of it and I can't wrap my head round the solution Regarding sensors etc - I am raycasting to get the waterdepth in every render loop so know what depth the sub is at both from the surface and the seabed. The EaseOut function starts at a 1.5m from surface or bottom. Cheers Richard
  8. Still on my submarine project .............................. I need to use easing to make diving through water more realistic. Dive commences with a slow start easing to a constant descent/ascent rate. This is acheived with the formula used on each renderloop (the equivalent of EaseIn) : incrementer += 0.01; diveRate += Math.pow(1, incrementer); submarine.position.y -= parseFloat(diveRate / 2500); This works fine. However I'm struggling to acheive the equivalent EaseOut formula to apply to the vessel before it "hits" the sea bed on the descent or "bursts" through the water at the surface on ascent. Easing using Babylon animation or the likes of Greensock is not an option as the user needs to interact with other 'features' whilst the dive is underway. I realise this is a 'maths' problem' not a babylon issue but if some one has an answer or could point me to a good tutorial I would appreciate it thanks as ever Richard C
  9. @Wingnut - That's the one my friend. An alternative I have just been playing with is based on what Deltkosh said........ I know the position of the parent box on collision. The emitters are always the same distance/position away from the empty and therefore I could reposition the child relative to the empty and then emit. But getAbsolutePosition is much easier and less code and works. Problem solved. Thanks again both. PS How do I mark/tag this topic as solved?
  10. I have tried various ways similar to your suggestion. The 'from verts' is giving me the 'shape I want my only real issue is getting the positions of the verts onCollide after the moveWithCollisions. So really there is only one Q to answer - how do I establish the actual position of the child mesh so that I can get to the verts. Thanks
  11. @Wingnut Thanks pal. That is the very PG I used to learn particle emission from vertices! 2 things ........ the bottom of the sub is not rectangular.square so the verts are not linear. Additionally, the children are not a plane but need to be an arc to get the correct sand cloud shape. If you picture such an event you will remember that sand 'kicked' up is far more of a cloud than square/rectangle/linear. All would be well if I could establish the position of each child at the point of collision. The seabed isn't flat of course- so the depth varies along the sub's path. It seems that moveWithCollision is displaying as it should but not updating the actually position of each child/mesh. It will be helpful to see what you come up with if you get the chance. Thanks
  12. @Deltakosh I am not updating the geometry per se. I am still on the same project as I have been in the recent opsts. I have a model submarine that dives from the surface to the seabed and the particles are to simulate the sand 'cloud' that is kicked up when the sub lands on the seabed. The sub dives and using moveWithCollisions to detect when the sub hits the seabed. Thanks
  13. Hi again I have a box being used as an Empty with 4 children. I am using moveWithCollisions on all 4 using the box mesh as the collider. When collided with the ground I have particles emitted from the vertices of each child mesh. All works well EXCEPT the particles are emitted from the children's original starting position rather than the point of collision where I want them to emit. I assumed getVerticesData(BABYLON.VertexBuffer.PositionKind) followed by .updateVerticesData(BABYLON.VertexBuffer.PositionKind),would establish the new position of each mesh but it doesn't. So my question is....... How to establish the new position of each child and therefore the vertices positions of each. Thanks RichardC
  14. @jerome @SvenFrankson @adam @Wingnut Thanks all. adam - your suggestion works for my project, so problem solved. I now have a working depth sounder. Right, on to the next challenge ! Cheers
  15. @adam @Wingnut Thanks Adam and Wingnut (hope things are good with you too). I am continuing to play but could I ask you or anyone else the answer to the my original question ............ 1. It seems to me that the ray should be intersecting with the actual mesh rather than the bounding box. Is this possible? I vaguely remember reading somewhere of there being a .getboundingMesh - does it exist or is it just wishful. Wingnut - I'm not sure using a heightmap for the seabed will be a workaround - I have modelled quite a few 3d coral reef objects that will of course build off the sea bed. I am thinking the seabed could be split into sections each according to height. I can then raycast from the bounding boxes from each of there together with the same for each coral reef. It would still be good to know if there is something like a bounding mesh. Adam, I assume you are suggesting I try making the 'seabed' a ribbon, albeit a static one. If a seabed were to move as much as the sine wave makes the ribbon in that PG I think we would have a Tsunami Cheers Ricard