From owner-freebsd-ports@FreeBSD.ORG Thu Apr 8 19:21:10 2010 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64310106564A for ; Thu, 8 Apr 2010 19:21:10 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from mailrelay.rz.uni-wuerzburg.de (mailrelay.rz.uni-wuerzburg.de [132.187.3.28]) by mx1.freebsd.org (Postfix) with ESMTP id 07B408FC18 for ; Thu, 8 Apr 2010 19:21:09 +0000 (UTC) Received: from virusscan.mail (localhost [127.0.0.1]) by mailrelay.mail (Postfix) with ESMTP id 03C4D5ADE1; Thu, 8 Apr 2010 21:21:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by virusscan.mail (Postfix) with ESMTP id F1C975ACD6; Thu, 8 Apr 2010 21:21:05 +0200 (CEST) X-Virus-Scanned: by amavisd-new at uni-wuerzburg.de Received: from mail.physik.uni-wuerzburg.de (wthp192.physik.uni-wuerzburg.de [132.187.40.192]) by mailmaster.uni-wuerzburg.de (Postfix) with ESMTP id C89F05CE3B; Thu, 8 Apr 2010 21:21:05 +0200 (CEST) Received: from wep4035 ([132.187.37.35]) by mail.physik.uni-wuerzburg.de (Lotus Domino Release 8.5.1FP2) with ESMTP id 2010040821210434-8696 ; Thu, 8 Apr 2010 21:21:04 +0200 Received: by wep4035 (sSMTP sendmail emulation); Thu, 08 Apr 2010 21:21:04 +0200 Date: Thu, 8 Apr 2010 21:21:04 +0200 From: Alexey Shuvaev To: Robert Huff Message-ID: <20100408192104.GA59297@wep4035.physik.uni-wuerzburg.de> References: <19389.58542.758803.443167@jerusalem.litteratus.org> <19389.61611.793371.369489@jerusalem.litteratus.org> MIME-Version: 1.0 In-Reply-To: <19389.61611.793371.369489@jerusalem.litteratus.org> Organization: Universitaet Wuerzburg User-Agent: Mutt/1.5.20 (2009-06-14) X-MIMETrack: Itemize by SMTP Server on domino1/uni-wuerzburg(Release 8.5.1FP2|March 17, 2010) at 04/08/2010 09:21:05 PM, Serialize by Router on domino1/uni-wuerzburg(Release 8.5.1FP2|March 17, 2010) at 04/08/2010 09:21:05 PM, Serialize complete at 04/08/2010 09:21:05 PM Content-Type: multipart/mixed; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: ports@freebsd.org Subject: Re: looking for simple 3d plotting program X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Apr 2010 19:21:10 -0000 --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Apr 08, 2010 at 11:05:15AM -0400, Robert Huff wrote: > > Robert Huff writes: > > > I have a project for which I need to produce a {gif, jpg, png} > > of a 3d space, with labled axes, and plot a small number (<25 ??) of > > points within it, either with labels or as icons. > > Two constraints: > > Current code is written in C. > > I expressed myself badly. What I should have said was: > > It must be usable via C function calls. > Not the best and the most elegant way to achieve this, but... you can try math/gnuplot. It can do 3d. --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=Makefile CC=gcc CCFLAGS= -g -Wall LDFLAGS= -lm -lpthread target= testgnuplot objects= testgnuplot.o gnuplot.o all: $(target) $(target): $(objects) $(CC) $(LDFLAGS) $(objects) -o $@ %.o: %.c $(CC) $(CCFLAGS) -c $< -o $@ clean: rm -f $(objects) rm -f $(target) --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=README gnuplot.c implements a helper function that invokes gnuplot to display the acquired data. You need to have the gnuplot package installed to take advantage of this function. You can reuse it in your program by adding the gnuplot.c and gnuplot.h files to your project and calling the function: int sendDataToGnuplot(int handle, float x0, float dX, double *buffer, int nbOfPointsPerCh, int nbOfCh); handle is the handle of the acquisition session returned by _PdAquireSubsystem. x0 is the origin of the x axis dX is the increment between each points on the x axis buffer contains the acquired data nbOfPointsPerCh contains the number of sampels acquired for each channel nbOfCh contains the number of channels --bg08WKrSYDhXBjb5--