Logo by mauxuam - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. October 21, 2020, 06:07:07 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Holograms.  (Read 1027 times)
Description: Hoe use this?
0 Members and 1 Guest are viewing this topic.
quaternion
Guest
« on: August 26, 2010, 11:34:41 PM »

I found this software: http://www.corticalcafe.com/prog_CGHmaker.htm, kan i use halogen or led lamp?
Logged
Schlega
Navigator
*****
Posts: 63


« Reply #1 on: August 27, 2010, 09:44:50 AM »

It sounds like that program's outpput depends on usinng a lazer source, but it is possible to make holograms that work in any light. It is even possible to draw them by hand.
Logged
quaternion
Guest
« Reply #2 on: August 27, 2010, 05:39:34 PM »

I think I must use lens for light point.

P.S. I found simplest example for holograms creation.

Code:
//holo.c--simple program for computer-generated holography
//Thad G. Walker University of Wisconsin-Madison
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "nrutil.h" //Numerical Recipes routines for memory allocation
#define twopi 6.283185307
#define R 75
//Resolving power of hologram
#define N 300
//hologram width in pixels
#define thres 0.6
//threshold for binary approximation
void main(){
char pixel,obj;
int X,Y,row,col,junk;
float **pix,kdf=twopi/2.0,ranphi,max=0.0,min=0.0,res=R;
FILE *out,*in;
out=fopen("holo.pgm","w");
// output file, N X N size graphics file
in=fopen("uwphysics.pgm","r"); //input file, R X R size graphics file
fprintf(out,"P5 %d %d 255\n",N,N);//header
fscanf(in,"%1s %1s %d %d %d",&junk,&junk,&junk,&junk,&junk);//header
srand(17);
//seed random number generator
pix=matrix(0,N-1,0,N-1);
//allocate memory for graphical output
for(X=0;X<N;X++){for(Y=0;Y<N;Y++){pix[X][Y]=0.0;}}
//initialization
//construct real hologram from input image
for(row=0;row<R;row++){for(col=0;col<R;col++){
fscanf(in,"%1c",&obj);
//read 1 byte at a time
if(obj!=0){
//all non-zero bytes given same intensity
ranphi=((float) rand())/((float) RAND_MAX)*twopi;
//select random phase
for(X=0;X<N;X++){for(Y=0;Y<N;Y++){
pix[X][Y]+=cos(kdf*(X*(1.-row/res)+Y*col/res)+ranphi);//add to hologram
}}
}
}}
//find max min
for(X=0;X<N;X++){for(Y=0;Y<N;Y++){
if(pix[X][Y]>max)max=pix[X][Y];
if(pix[X][Y]<min)min=pix[X][Y];
}}
//print output file
for(X=0;X<N;X++){for(Y=0;Y<N;Y++){
if((pix[X][Y]-min)/(max-min)>thres){pixel=255;
}else{pixel=0;}
fprintf(out,"%c",pixel);
}}
}
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.081 seconds with 26 queries. (Pretty URLs adds 0.004s, 2q)