Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | chip programmers | 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