Star Wars "Light Saber"

General FreeBASIC programming questions.
albert
Posts: 5916
Joined: Sep 28, 2006 2:41
Location: California, USA

Star Wars "Light Saber"

Postby albert » Sep 09, 2020 0:35

I came up with an idea for a Star Wars "Light Saber"

You have a handle base and then a telescoping rod that comes out of it , with a crystal on it..

So the top crystal has a cover that closes up on the base handle..

You push a rocker switch up or down , to extend and retract the telescoping rod..

Then at the base you have a laser , that comes out and shines to the telescoping crystal..

The laser is at an angle , so the light travels from the base to the telescoping crystal and gets reflected back down to the base a little offset..
This offset would make the laser travel all around the base and back.. To create a ring of laser...

So you have a top crystal on a telescoping rod , and bottom crystal..

The laser travels up to the top and gets reflected back down a little offset and then gets reflected back up a little offset..
And then gets reflected back down a little offset.

So the laser travels all around the base to the top..Creating a light tube around the telescoping rod.

Using ultra-violet lasers , it might be able to cut through stuff.. like paper ???
dafhi
Posts: 1358
Joined: Jun 04, 2005 9:51

Re: Star Wars "Light Saber"

Postby dafhi » Sep 09, 2020 2:40

you had me at "The laser is at an angle"

Hacksmith on YT made something
dodicat
Posts: 6687
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Star Wars "Light Saber"

Postby dodicat » Sep 09, 2020 8:16

I think the idea is like light bouncing around inside a perfect reflecting sphere say.
If you see anything from outside then the light is getting away, so it will soon all be gone.
If you could peek inside you would see an eternal glow?
But by seeing it in any way, you are using it's energy so it will soon all be gone.
If you don't peek in, but wait 100 years to peek in, if you then see a flash then bingo it has been bouncing around for 100 years.
But a photon has been given a little mass by the physics fraternity, because of this the inside of the sphere will warm up thus using up the precious energy of the light photons, so darkness will soon prevail inside the sphere.
Also the physics fraternity, aided by the maths fraternity, have given us quantum tunnelling (via complex numbers), so light will escape the sphere
disguised as the i part of a complex number, tunnelling through any perfect reflector, so you cannot win any way.
angros47
Posts: 1673
Joined: Jun 21, 2005 19:04

Re: Star Wars "Light Saber"

Postby angros47 » Sep 09, 2020 9:21

First of all, there is no such a thing like a telescopic crystal.

Also, trapping light inside a crystal would have a serious issue: true, you can use refraction and reflection to make a photon "bounce" around, following a path inside the crystal, but such a path would either be open, or close: in an open path. the photons would reach the end, and escape, so the crystal could not store them. In a closed path, the photons would never leave the crystal, in theory, because they would only reach the starting point and move along the same path again, and again, but unfortunately the starting point is the light source, so, to prevent the photons to leave the crystal, the light source should be inside the crystal itself.
albert
Posts: 5916
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Star Wars "Light Saber"

Postby albert » Sep 09, 2020 16:41

No, You have a cap at the top , and the cap has a crystal or mirror that reflects the laser back down to the base..
Then the base has a similar crystal or mirror that reflects the laser back up to the top..

So the laser goes up and down all around the telescoping rod..
So it creates a tube of laser , around the telescoping rod..

For the telescoping rod... Not sure how you would make the rod extend and retract with motors???
Maybe you would need to manually extend the rod?
angros47
Posts: 1673
Joined: Jun 21, 2005 19:04

Re: Star Wars "Light Saber"

Postby angros47 » Sep 09, 2020 16:55

albert wrote:Then the base has a similar crystal or mirror that reflects the laser back up to the top..


This is not possible, because if the base has already the laser emitter. If you put the mirror over the emitter, it would block the laser beam, that would be unable to reach the mirror on the top.
albert
Posts: 5916
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Star Wars "Light Saber"

Postby albert » Sep 09, 2020 19:51

I wonder if it's possible to create a ring laser crystal , instead of a beam laser crystal.

So when the crystal starts lasing , it lases all around the ring. Creating a ring of laser instead of a beam...

Maybe you could use beam splitters to get the ring laser , instead of mirrors...
Stonemonkey
Posts: 646
Joined: Jun 09, 2005 0:08

Re: Star Wars "Light Saber"

Postby Stonemonkey » Sep 09, 2020 22:09

Not a lightsaber but you might find this of interest. No idea if it was a scam or if got anywhere.

https://youtu.be/zVn3q0mkijw
albert
Posts: 5916
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Star Wars "Light Saber"

Postby albert » Sep 09, 2020 22:33

I wonder what happens when you shine two lasers together , at a point away??

When the two parallel lasers come together , they might diffuse??

So the "Light Saber" might not need a telescoping rod to hold the reflecting end cap..

Maybe , you could just use multiple lasers and beam splitters..
Where the laser beams coming out , all converge at a point away and diffuse.. Like 30 to 40 inches to convergence...
albert
Posts: 5916
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Star Wars "Light Saber"

Postby albert » Sep 09, 2020 22:48

Without the telescoping rod at the center..

You couldn't have sword battles.. The lasers would go through each other..

Unless you could somehow magnetize the laser.. Then the magnetic repulsion , would allow for sword battles..
angros47
Posts: 1673
Joined: Jun 21, 2005 19:04

Re: Star Wars "Light Saber"

Postby angros47 » Sep 10, 2020 0:01

albert wrote:I wonder if it's possible to create a ring laser crystal , instead of a beam laser crystal.


No, because "ring laser crystal" means nothing, it's a term that makes no sense.

albert wrote:When the two parallel lasers come together , they might diffuse??


If they are parallel, they cannot come together. If they do, they are not parallel. Check the definition of "parallel": In geometry, parallel lines are lines in a plane which do not meet https://en.wikipedia.org/wiki/Parallel_(geometry)
albert
Posts: 5916
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Star Wars "Light Saber"

Postby albert » Sep 10, 2020 2:16

@angros47

I said , the lasers would converge at a point away....30 or 40 inch convergence..

So they are not exactly parallel... They come together... so their at an angle to each other..
Stonemonkey
Posts: 646
Joined: Jun 09, 2005 0:08

Re: Star Wars "Light Saber"

Postby Stonemonkey » Sep 10, 2020 8:01

albert wrote:I wonder what happens when you shine two lasers together , at a point away??..


Lasers can be focused to a point enough to cause the air to emit light at the point of focus, there are some videos on YouTube of some sort of projector doing this to create 3d images floating in the air made up of points of light.
dodicat
Posts: 6687
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Star Wars "Light Saber"

Postby dodicat » Sep 10, 2020 12:53

Light Sabre mingling

Code: Select all



#include "crt.bi"

Type V3
    As Single x,y,z
    As Ulong col
End Type

Type _float As V3


Dim Shared As v3 eyepoint=Type<V3>(400,300,600)
#define map(a,b,x,c,d) ((d)-(c))*((x)-(a))/((b)-(a))+(c)
Sub RotateArray(wa() As V3,result() As V3,angle As _float,centre As V3)
    Dim As Single dx,dy,dz,w
    Dim As Single SinAX=Sin(angle.x)
    Dim As Single SinAY=Sin(angle.y)
    Dim As Single SinAZ=Sin(angle.z)
    Dim As Single CosAX=Cos(angle.x)
    Dim As Single CosAY=Cos(angle.y)
    Dim As Single CosAZ=Cos(angle.z)
    Redim result(Lbound(wa) To Ubound(wa))
    For z As Long=Lbound(wa) To Ubound(wa)
        dx=wa(z).x-centre.x
        dy=wa(z).y-centre.y
        dz=wa(z).z-centre.z
        Result(z).x=((Cosay*Cosaz)*dx+(-Cosax*Sinaz+Sinax*Sinay*Cosaz)*dy+(Sinax*Sinaz+Cosax*Sinay*Cosaz)*dz)+centre.x
        result(z).y=((Cosay*Sinaz)*dx+(Cosax*Cosaz+Sinax*Sinay*Sinaz)*dy+(-Sinax*Cosaz+Cosax*Sinay*Sinaz)*dz)+centre.y
        result(z).z=((-Sinay)*dx+(Sinax*Cosay)*dy+(Cosax*Cosay)*dz)+centre.z
        w =1 + (result(z).z/eyepoint.z)
        result(z).x =(result(z).x-eyepoint.x)/w+eyepoint.x
        result(z).y =(result(z).y-eyepoint.y)/w+eyepoint.y
        result(z).z =(result(z).z-eyepoint.z)/w+eyepoint.z
        result(z).col=wa(z).col
    Next z
End Sub

Sub translatearray(a() As V3,x As Long,y As Long)
    For n As Long=Lbound(a) To Ubound(a)
        a(n).x+=x:a(n).y+=y
    Next n
End Sub

Function onbox(ctr As V3,l As Long,h As Long,d As Long,p As V3) As Long
    Dim As Long a,b,c=0
    Dim As Long ax,ay,az,at
    ax=(p.x>ctr.x-l And p.x<ctr.x+l)
    ay=(p.y>ctr.y-h And p.y<ctr.y+h)
    az=(p.z>ctr.z-d And p.z<ctr.z+d)
    at=(ax And ay And az)=0
    Return at
End Function

Sub AddABox(a() As V3,bx As V3,l As Long,h As Long,d As Long,col As Ulong)
    Dim As Long counter=Ubound(a),c
    For x As Long=bx.x-l-c To bx.x +l +c Step 2
        For y As Long=bx.y-h-c To bx.y +h +c Step 2
            For z As Long=bx.z-d-c To bx.z +d +c Step 2
                If onbox(bx,l,h,d,Type<V3>(x,y,z)) Then
                    counter+=1
                    Redim Preserve a(Lbound(a) To counter)
                    Var cc=Cptr(Ubyte Ptr,@col)
                    Var sz1=bx.z-d-c,sz2=bx.z +d +c
                    Var mp= ((.4)-(1))*((z)-(sz1))/((sz2)-(sz1))+(1)
                    Var nc=Rgb(mp*cc[2],mp*cc[1],mp*cc[0])
                    a(counter)=Type<V3>(x,y,z,nc)
                End If
            Next z
        Next y
    Next x
End Sub

Sub QsortZ(array() As V3,begin As Long,Finish As Ulong)
    Dim As Long i=begin,j=finish
    Dim As V3 x =array(((I+J)\2))
    While I <= J
        While array(I).z > X .z:I+=1:Wend
            While array(J).z < X .z:J-=1:Wend
                If I<=J Then Swap array(I),array(J): I+=1:J-=1
            Wend
            If J >begin Then QsortZ(array(),begin,J)
            If I <Finish Then QsortZ(array(),I,Finish)
        End Sub
       
Function Regulate(Byval MyFps As Long,Byref fps As Long) As Long
    Static As Double timervalue,_lastsleeptime,t3,frames
    Var t=Timer
    frames+=1
    If (t-t3)>=1 Then t3=t:fps=frames:frames=0
    Var sleeptime=_lastsleeptime+((1/myfps)-T+timervalue)*1000
    If sleeptime<1 Then sleeptime=1
    _lastsleeptime=sleeptime
    timervalue=T
    Return sleeptime
End Function

Screen 20,32
Redim As V3 a(),a1()

AddABox(a(),Type<V3>(400,300,0),250,7,7, Rgb(240,240,255))
AddABox(a1(),Type<V3>(400,300,0),250,7,7,Rgb(200,200,0) )

        Redim As V3 b(),b1()
        Redim As v3 T(Ubound(a)+Ubound(a1))
        Dim As v3 c=Type<v3>(400,300,0),c1=Type<v3>(400,300,0)
        Dim As Single ang
        Dim As Long fps
        Dim As single kx=3/2,ky=3/2,k1x=3/2,k1y=-3/2
       
        Do
            ang+=.01
            c.y+=ky:c.x+=kx
            c1.y+=k1y:c1.x+=k1x
            If c.x<150 Or c.x>900 Then kx=-kx
            If c.y<150 Or c.y>650 Then ky=-ky
           
            If c1.x<150 Or c1.x>900 Then k1x=-k1x
            If c1.y<150 Or c1.y>650 Then k1y=-k1y
            eyepoint.x=c.x:eyepoint.y=c.y
            RotateArray(a(),b(),Type<_float>(ang,ang/2,ang/3),c)
            TranslateArray(a(),kx,ky)
           
            eyepoint.x=c1.x:eyepoint.y=c1.y
            RotateArray(a1(),b1(),Type<_float>(ang/2,ang,ang/2),c1)
            TranslateArray(a1(),k1x,k1y)
            memcpy(@T(0),@b(0),(Ubound(b)-Lbound(b)+1)*Sizeof(V3))
            memcpy(@T(Ubound(b)+0),@b1(0),(Ubound(b1)-Lbound(b1)+1)*Sizeof(V3))
           
            Screenlock
            Cls
            Draw String(10,10),"FPS =" & fps
           
            Qsortz(T(),Lbound(T),Ubound(T))
            For n As Long=Lbound(T) To Ubound(T)
             
                var rad=map(-2650,450,T(n).z,2,4)
                Circle(T(n).x,T(n).y),rad,T(n).col,,,,f
            Next n
            Screenunlock
            Sleep regulate(60,fps),1
        Loop Until Len(Inkey)
     
        Sleep
         
badidea
Posts: 2149
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Star Wars "Light Saber"

Postby badidea » Sep 10, 2020 23:18

At the National Ignition Facility they try to point 192 high power lasers in a tiny capsule filled with deuterium and tritium to create small nuclear explosion. They have not succeeded yet. The installation is also not very portable: https://en.wikipedia.org/wiki/National_Ignition_Facility#/media/File:NIF_Laser_Bay.jpg

Return to “General”

Who is online

Users browsing this forum: No registered users and 5 guests