Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Ende · Mar 02, 2010 at 07:39 PM · 2dguigraphics

Best way to draw an ECG trace.

Ok my desired effect is as thus: http://www.youtube.com/watch?v=7N4viIanngg&feature=fvw as I am sure you have seen on ER and suchlike.

Looking at this as a 2d depiction I am using the x axis as a constant rate of movement where after 30 seconds you return to the start position. The height of the Y axis needs to be take from a a script that returns a TotalAmplitude at any given time. So increases in the amount of blips is controlled by that changing rather than the x axis speeding up. I would like the x-axis to be plotted every 1/25th of a second.

Now I want to get a nice crisp display so I was wondering will this be possible to "plot" on the GUI layer (I am using the Indie version) or would I be best sticking with what I am doing at the moment that being attempting to move a sphere with an attached trail renderer.

Any help setting me along the right path would be appreciated as this will take some time for me to figure out no matter which route is best and I'd rather know I was not barking up the wrong tree!

Here is my code for the trail render version. This however disappears my trace to early with a TrailRender time of 30. I am just using the Y Cos function for now as a trial.

var TotalAmplitude: float; var ECGTrace: Transform;

function Start() {

 yield WaitForSeconds (15);
 Instantiate (ECGTrace, Vector3(-10, 0, 50), Quaternion.identity);
 yield WaitForSeconds (15);
 Destroy (gameObject);

}

function Update() {

 y = Mathf.Cos (3.142 * TotalAmplitude) / 10;

 transform.position += Vector3(2 * Time.deltaTime, y, 0);

 TotalAmplitude = TotalAmplitude + 0.01;

}

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ende · Mar 02, 2010 at 09:43 PM 0
Share

If people don't understand what I mean by my trace disappearing early I can upload a video to show this.

avatar image yoyo · Feb 03, 2011 at 06:49 PM 0
Share

2D line drawing would help. If you want Unity devs to implement GUI.DrawLine then please vote for my feature request ... http://feedback.unity3d.com/forums/15792-unity/suggestions/1451375-gui-drawline

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Ende · Mar 03, 2010 at 02:41 PM

Ok using a trail renderer on an invisible object is the way to go using the above script as an example. Here is a video of what I have got - http://www.youtube.com/watch?v=donNeloSZGI

However, I am cheating and smacking a plane infront of the traces to hide the fact that they still disappear suddenly when their life has terminated. This is not a real issue I guess.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Yokimato · Dec 17, 2012 at 03:16 PM 0
Share

Link is dead. Can you please update it? Also, I'd love to see the code on how you achieve this if you're willing to share it!

avatar image
0

Answer by xxMDAxx · Mar 06, 2014 at 12:23 AM

Please look at the following blog if you want to achieve this effect. Various methods are given there to achieve the effect along with source code and webplayer (shader, particle and mesh creation).

http://ndunity3d.blogspot.co.uk/

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

Choosing the right resolution 1 Answer

2D Post Processing Not Working in Unity 2020.3.0f1 0 Answers

Store/Stack Items 0 Answers

Developing 2D games in Unity 1 Answer

GUI Texture Resolution 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges