{"id":1301,"date":"2012-10-21T22:53:08","date_gmt":"2012-10-21T19:53:08","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=1301"},"modified":"2019-12-23T03:59:06","modified_gmt":"2019-12-22T19:59:06","slug":"trajectory-test-scene","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2012\/10\/21\/trajectory-test-scene\/","title":{"rendered":"Trajectory Test Scene 2.0"},"content":{"rendered":"<p><a title=\"start webplayer demo\" href=\"http:\/\/unitycoder.com\/upload\/demos\/Trajectory_scene2\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1302\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/10\/21\/trajectory-test-scene\/trajectory_example_mouse\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/10\/trajectory_example_mouse.jpg?fit=680%2C479&amp;ssl=1\" data-orig-size=\"680,479\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"trajectory_example_mouse\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/10\/trajectory_example_mouse.jpg?fit=680%2C479&amp;ssl=1\" class=\"alignnone size-full wp-image-1302\" title=\"trajectory_example_mouse\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/10\/trajectory_example_mouse.jpg?resize=680%2C479\" alt=\"\" width=\"680\" height=\"479\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/10\/trajectory_example_mouse.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/10\/trajectory_example_mouse.jpg?resize=300%2C211&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<p>Using <a title=\"http:\/\/answers.unity3d.com\/questions\/248788\/calculating-ball-trajectory-in-full-3d-world.html\" href=\"http:\/\/answers.unity3d.com\/questions\/248788\/calculating-ball-trajectory-in-full-3d-world.html\" target=\"_blank\" rel=\"noopener noreferrer\">trajectory script<\/a> from unity answers, this is a test for the <a title=\"http:\/\/unitycoder.com\/blog\/2012\/10\/14\/rampart-prototype-seed-fill\/\" href=\"http:\/\/unitycoder.com\/blog\/2012\/10\/14\/rampart-prototype-seed-fill\/\" target=\"_blank\" rel=\"noopener noreferrer\">Rampart prototype<\/a>..<\/p>\n<p>Would be nice to add the trajectory preview line also (I think I&#8217;ve seen that in the forums..) and some randomness or wind?<\/p>\n<p>Red target mark is light projector, with custom image + modified blend mode in the projector shader (to make it brighter).<br \/>\nWingdings-font has that target pointer character.<\/p>\n<p><strong>Version 2.0 (image#2)<\/strong><br \/>\n&#8211; Added cannon tube rotation towards mouse<br \/>\n&#8211; Added cannon angle control with mouse scroll<br \/>\n&#8211; Added sounds (shoot &amp; explosion)<br \/>\n&#8211; Explosion sound is delayed based on distance, not sure how to do exponential decay properly, now delay is:\u00a0 (exploDistance*exploDistance)*0.0001;<br \/>\n&#8211; Added particle effects, some rigidbodies on the ground, fog..<br \/>\n&#8211; Problems: Trajectory preview not accurate: used this code for spline: <a title=\"http:\/\/forum.unity3d.com\/threads\/12588-Projection-Trajectory-Arc\" href=\"http:\/\/forum.unity3d.com\/threads\/12588-Projection-Trajectory-Arc\" target=\"_blank\" rel=\"noopener noreferrer\">GetQuadraticCoordinates()<\/a>) and this for the <a title=\"http:\/\/hyperphysics.phy-astr.gsu.edu\/hbase\/traj.html\" href=\"http:\/\/hyperphysics.phy-astr.gsu.edu\/hbase\/traj.html\" target=\"_blank\" rel=\"noopener noreferrer\">peak height calculation<\/a>.<\/p>\n<p><strong>Webplayer:<\/strong><br \/>\n<a title=\"start webplayer demo\" href=\"http:\/\/unitycoder.com\/upload\/demos\/TrajectoryScene\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/unitycoder.com\/upload\/demos\/TrajectoryScene\/<\/a> (v1.0 &#8211; always shooting at 45 degree angle..)<br \/>\n<a title=\"http:\/\/unitycoder.com\/upload\/demos\/Trajectory_scene2\/\" href=\"http:\/\/unitycoder.com\/upload\/demos\/Trajectory_scene2\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/unitycoder.com\/upload\/demos\/Trajectory_scene2\/<\/a> (v2.0)<\/p>\n<p><strong>Download source:<\/strong><br \/>\ncoming later..<\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#2: Updated version<\/strong><\/p>\n<p><a title=\"start webplayer demo\" href=\"http:\/\/unitycoder.com\/upload\/demos\/Trajectory_scene2\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1323\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/10\/21\/trajectory-test-scene\/cannon_ballistic_trajectory2\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/10\/cannon_ballistic_trajectory2.jpg?fit=680%2C398&amp;ssl=1\" data-orig-size=\"680,398\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"cannon_ballistic_trajectory2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/10\/cannon_ballistic_trajectory2.jpg?fit=680%2C398&amp;ssl=1\" class=\"alignnone size-full wp-image-1323\" title=\"cannon_ballistic_trajectory2\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/10\/cannon_ballistic_trajectory2.jpg?resize=680%2C398\" alt=\"\" width=\"680\" height=\"398\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/10\/cannon_ballistic_trajectory2.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/10\/cannon_ballistic_trajectory2.jpg?resize=300%2C175&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using trajectory script from unity answers, this is a test for the Rampart prototype.. Would be nice to add the trajectory preview line also (I think I&#8217;ve seen that in the forums..) and some randomness or wind? Red target mark is light projector, with custom [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1323,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4,3],"tags":[344,1003,346,76,87,228,1001,88,345,1002,343],"class_list":["post-1301","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-demos","category-unity3d","tag-ballistic","tag-force","tag-grenade","tag-line","tag-mouse","tag-physics","tag-projectile","tag-shoot","tag-target","tag-throw","tag-trajectory"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/10\/cannon_ballistic_trajectory2.jpg?fit=680%2C398&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-kZ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/1301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=1301"}],"version-history":[{"count":11,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/1301\/revisions"}],"predecessor-version":[{"id":5143,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/1301\/revisions\/5143"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/1323"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=1301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=1301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=1301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}