Based on that data, another ray cast is performed and the process continues until there are either no more hits or the beam threshold is reached. If the ray hits another object in the physics world, the ray's reflection is calculated and extruded to another point. This essentially completes the demo walkthrough - on a repeating timer, a ray cast is made from the turret and a set of laser lines is drawn. Restart turret rotating after firing is finished Upon completion of the transition, we call the resetBeams() function which clears/resets the group: local function resetBeams() Turret = display.newImageRect( mirrorGroup, "turret.png", 48, 48 ) If you would like to contribute to the wiki of Ray-MMD, please contact us. The turret itself is a standard display object with a radial physics body - yes, ray casting detection/reflection works on radial bodies too! - Create turret This Tutorial is based on Ray MMD 1.5.2.Model: SourVer.1.02. Welcome to the Ray-MMD wiki Ray-MMD is a powerful physics-based rendering library for MikuMikuDance. You can set up your physics world however you wish, but this example loops through a series of tables containing x, y, and rotation values for each mirror: - Set up mirror positions relative to the center of the content area If you haven't downloaded the demo project, please do so and follow along with the code.Īn important step in this demo is configuring the "world" - in this case a room of mirrors with a laser turret in the center.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |