Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by Lapsa. 06/20/26 18:18
Ranger by Robert Pardo - now for Zorro
by Smallz. 06/20/26 11:23
Z12 live performance
by jcl. 06/19/26 11:21
Z9 getting Error 058
by jcl. 06/16/26 09:51
How to select between IB accounts by script?
by AndrewAMD. 06/13/26 15:44
Zorro tutorial ideas?
by AndrewAMD. 06/13/26 15:01
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 4,443 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Oscilloscope #435776
01/14/14 04:18
01/14/14 04:18
Joined: Feb 2006
Posts: 52
C
carlpa Offline OP
Junior Member
carlpa  Offline OP
Junior Member
C

Joined: Feb 2006
Posts: 52
I am working to develop a program to demonstrate physiologic effects using a spring model. Part of the output will be 3 - 5 waveforms as if looking at an oscilloscope. I was considering the use of particles or changing pixels on a bmap. I do not wish to reinvent the wheel. Does anyone have a solution or the ability to direct me to a solution. My students, residents, fellows and I will be very grateful. Thank you in advance.


Researcher & clinician. A6, A7, & A8
First computer a Commodore Pet
Re: Oscilloscope [Re: carlpa] #435789
01/14/14 10:19
01/14/14 10:19
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
I would do this with the "draw_line" (http://www.conitec.net/beta/draw_line.htm) instructions in combination with some simple math function to create the coordinates.

Re: Oscilloscope [Re: oliver2s] #435791
01/14/14 10:32
01/14/14 10:32
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Here I made small example:

Code:
function waveform1(var x)
{
	return sinv(x*10)*20 + screen_size.y/2 - 10;	
}

void main()
{
	wait(1);
	
	screen_color.red=1;
	screen_color.green=1;
	screen_color.blue=1;

	while(1)
	{
		draw_line(nullvector,NULL,100);
		var x; for(x=0;x<screen_size.x;x++)
		{			
			var y=waveform1(x);
			
			draw_line(vector(x,y,0),vector(255,255,255),100);
		}
		
		wait(1);	
	}
}


Re: Oscilloscope [Re: oliver2s] #435833
01/15/14 00:09
01/15/14 00:09
Joined: Feb 2006
Posts: 52
C
carlpa Offline OP
Junior Member
carlpa  Offline OP
Junior Member
C

Joined: Feb 2006
Posts: 52
Works well. Thank you very much. Will build your routine in my project. I might return if success eludes me.


Researcher & clinician. A6, A7, & A8
First computer a Commodore Pet

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1