Jump to content

Happy Holidays


youknowwho4eva
 Share

Recommended Posts

A very festive display. Just replace us.bmp with a bmp of your family, use it as a virtual holiday card, or just watch the flames crackle. I believe I added all the required Au3Irrlicht files this time so you should be able to unzip and run. The us.bmp is my daughter, ravens defensive lineman Haloti Ngata, and myself. Hope ya'll enjoy.

http://www.box.net/shared/n5is28yi5h

Of course wouldn't be possible without Percy's Au3Irrlicht.

All models (all though only simple ones for this one) done by myself. And I did put the source in there so you can add a stocking or anything else you desire.

Latest version: Floating camera, digital picture frame (requires a folder named pics in scriptdir with bmp's and thumb.db. If no thumb.db either put a random file in there or change the script as stated in post 11)

#include <GUIConstants.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
#include <WINAPI.au3>
#include <IrrlichtPluginUtils.au3>
#include <GUIConstantsEx.au3>
#include <math.au3>
#include <color.au3>
#include <misc.au3>
#include <IE.au3> 
dim $seq[100000], $pic[1000000], $us[1000000]
$dll = "user32.dll"
Global $y,$y2,$y3,$guess
$turn = 0
HotKeySet("{ESC}", "Terminate")
$folder = dirgetsize(@scriptdir & "\pics",1)
$picsearch = FileFindFirstFile(@scriptdir & "\pics\*.bmp")
For $i = 1 To $folder[1]
$pic[$i] = FileFindNextFile($picsearch)
Next
$picture = @scriptdir & "\pics\" & $pic[1]
;pink, pink, pink
$Hwnd = CreateLayeredDevice( "Trans", 0, 0, @DesktopWidth, @DesktopHeight, 255, 0, 128, 1 )


;Don't forget the light! Never.
$Light1 = AddLightSceneNode( 0, 0, 0, -100, 0, 0, 0, 20 )
$SLight = AddNewSLight( 0, 50, 1, 500, 1000, $ELT_spot )
SetLightSpecularColor( $SLight, .1, .1, .1 )
SetLightData( $Light1, $SLight )
$Light2 = AddLightSceneNode( 0, 0, 0, 100, 0, 0, 0, 0 )
$SLight2 = AddNewSLight( 0, 100, 1, 500, 1000, $ELT_POINT )
SetLightSpecularColor( $SLight2, .1, .1, .1 )
SetLightData( $Light2, $SLight2 )



$redbrick = getmesh(@scriptdir &  "\redbrick.3ds")
$redbricknode = addmeshscenenode($redbrick)
$redbricknodetexture = getmaterial ($redbricknode,0)
setdiffusecolor($redbricknodetexture,0,0,0,0)
setposition($redbricknode,0,0,0)
setscale($redbricknode,3,3,3)
setrotation($redbricknode,0,0,0)
SetMaterialTexture( $redbrickNode, 0, GetTexture( @scriptdir & "\white.bmp" ) )
SetMaterialFlag( $redbricknode, $EMF_LIGHTING, 0 )
;~ setvisible($redbricknode,0)

$Camera = AddCameraSceneNode( $redbricknode, 7, -3, -17, 0, -15, 0 )

$darkbrick = getmesh(@scriptdir &  "\darkbrick.3ds")
$darkbricknode = addmeshscenenode($darkbrick)
$darkbricknodetexture = getmaterial ($darkbricknode,0)
setdiffusecolor($darkbricknodetexture,0,0,0,0)
setposition($darkbricknode,0,0,0)
setscale($darkbricknode,3,3,3)
setrotation($darkbricknode,0,0,0)
SetMaterialTexture( $darkbrickNode, 0, GetTexture( @scriptdir & "\white.bmp" ) )
SetMaterialFlag( $darkbricknode, $EMF_LIGHTING, 0 )
;~ setvisible($darkbricknode,0)

$mortar = getmesh(@scriptdir &  "\mortar.3ds")
$mortarnode = addmeshscenenode($mortar)
$mortarnodetexture = getmaterial ($mortarnode,0)
setdiffusecolor($mortarnodetexture,0,0,0,0)
setposition($mortarnode,0,0,0)
setscale($mortarnode,3,3,3)
setrotation($mortarnode,0,0,0)
SetMaterialTexture( $mortarNode, 0, GetTexture( @scriptdir & "\white.bmp" ) )
SetMaterialFlag( $mortarnode, $EMF_LIGHTING, 0 )
;~ setvisible($mortarnode,0)

$slat = getmesh(@scriptdir &  "\slat.3ds")
$slatnode = addmeshscenenode($slat)
$slatnodetexture = getmaterial ($slatnode,0)
setdiffusecolor($slatnodetexture,0,0,0,0)
setposition($slatnode,0,-8.4,-4)
setscale($slatnode,3,3,3)
setrotation($slatnode,0,0,0)
SetMaterialTexture( $slatNode, 0, GetTexture( @scriptdir & "\white.bmp" ) )
SetMaterialFlag( $slatnode, $EMF_LIGHTING, 0 )
;~ setvisible($slatnode,0)

$frame = getmesh(@scriptdir &  "\frame.3ds")
$framenode = addmeshscenenode($frame)
$framenodetexture = getmaterial ($framenode,0)
setdiffusecolor($framenodetexture,0,0,0,0)
setposition($framenode,0,-1,-11)
setscale($framenode,3,3,3)
setrotation($framenode,0,0,0)
SetMaterialTexture( $frameNode, 0, GetTexture( @scriptdir & "\white.bmp" ) )
SetMaterialFlag( $framenode, $EMF_LIGHTING, 0 )
;~ setvisible($framenode,0)

$usNode = AddCubeSceneNode( 20 )
$us[1] = GetTexture( $picture )
SetMaterialTexture( $usNode, 0, $us[1] )
SetMaterialFlag( $usNode, $EMF_LIGHTING, 0 )
setscale($usnode,.54,.54,.001)
setrotation($usnode,20,0,0)
setposition($usnode,0,-1.1,-11.1)

$backflamered = getmesh(@scriptdir &  "\backflamered.3ds")
$backflamerednode = addmeshscenenode($backflamered)
$backflamerednodetexture = getmaterial ($backflamerednode,0)
setdiffusecolor($backflamerednodetexture,0,0,0,0)
setposition($backflamerednode,0,-35,-9)
setscale($backflamerednode,3,3,3)
setrotation($backflamerednode,0,180,0)
SetMaterialTexture( $backflameredNode, 0, GetTexture( @scriptdir & "\red.bmp" ) )
SetMaterialFlag( $backflamerednode, $EMF_LIGHTING, 0 )
setvisible($backflamerednode,0)

$frontflameyellow = getmesh(@scriptdir &  "\frontflameyellow.3ds")
$frontflameyellownode = addmeshscenenode($frontflameyellow)
$frontflameyellownodetexture = getmaterial ($frontflameyellownode,0)
setdiffusecolor($frontflameyellownodetexture,0,0,0,0)
setposition($frontflameyellownode,0,-38,-10.8)
setscale($frontflameyellownode,3,3,3)
setrotation($frontflameyellownode,0,180,0)
SetMaterialTexture( $frontflameyellowNode, 0, GetTexture( @scriptdir & "\white.bmp" ) )
SetMaterialFlag( $frontflameyellownode, $EMF_LIGHTING, 0 )
setvisible($frontflameyellownode,0)

$backflameorange = getmesh(@scriptdir &  "\backflameorange.3ds")
$backflameorangenode = addmeshscenenode($backflameorange)
$backflameorangenodetexture = getmaterial ($backflameorangenode,0)
setdiffusecolor($backflameorangenodetexture,0,0,0,0)
setposition($backflameorangenode,0,-35,-9)
setscale($backflameorangenode,3,3,3)
setrotation($backflameorangenode,0,180,0)
SetMaterialTexture( $backflameorangeNode, 0, GetTexture( @scriptdir & "\white.bmp" ) )
SetMaterialFlag( $backflameorangenode, $EMF_LIGHTING, 0 )
setvisible($backflameorangenode,0)

$frontflamered = getmesh(@scriptdir &  "\frontflamered.3ds")
$frontflamerednode = addmeshscenenode($frontflamered)
$frontflamerednodetexture = getmaterial ($frontflamerednode,0)
setdiffusecolor($frontflamerednodetexture,0,0,0,0)
setposition($frontflamerednode,0,-38,-10.8)
setscale($frontflamerednode,3,3,3)
setrotation($frontflamerednode,0,180,0)
SetMaterialTexture( $frontflameredNode, 0, GetTexture( @scriptdir & "\red.bmp" ) )
SetMaterialFlag( $frontflamerednode, $EMF_LIGHTING, 0 )
setvisible($frontflamerednode,0)

$backflameyellow = getmesh(@scriptdir &  "\backflameyellow.3ds")
$backflameyellownode = addmeshscenenode($backflameyellow)
$backflameyellownodetexture = getmaterial ($backflameyellownode,0)
setdiffusecolor($backflameyellownodetexture,0,0,0,0)
setposition($backflameyellownode,0,-35,-9)
setscale($backflameyellownode,3,3,3)
setrotation($backflameyellownode,0,180,0)
SetMaterialTexture( $backflameyellowNode, 0, GetTexture( @scriptdir & "\white.bmp" ) )
SetMaterialFlag( $backflameyellownode, $EMF_LIGHTING, 0 )
setvisible($backflameyellownode,0)

$frontflameorange = getmesh(@scriptdir &  "\frontflameorange.3ds")
$frontflameorangenode = addmeshscenenode($frontflameorange)
$frontflameorangenodetexture = getmaterial ($frontflameorangenode,0)
setdiffusecolor($frontflameorangenodetexture,0,0,0,0)
setposition($frontflameorangenode,0,-38,-10.8)
setscale($frontflameorangenode,3,3,3)
setrotation($frontflameorangenode,0,180,0)
SetMaterialTexture( $frontflameorangeNode, 0, GetTexture( @scriptdir & "\white.bmp" ) )
SetMaterialFlag( $frontflameorangenode, $EMF_LIGHTING, 0 )
setvisible($frontflameorangenode,0)

$woodholder = getmesh(@scriptdir &  "\woodholder.3ds")
$woodholdernode = addmeshscenenode($woodholder)
$woodholdernodetexture = getmaterial ($woodholdernode,0)
setdiffusecolor($woodholdernodetexture,0,0,0,0)
setposition($woodholdernode,0,-44,-9.2)
setscale($woodholdernode,3,3,3)
setrotation($woodholdernode,0,180,0)
SetMaterialTexture( $woodholderNode, 0, GetTexture( @scriptdir & "\white.bmp" ) )
SetMaterialFlag( $woodholdernode, $EMF_LIGHTING, 0 )
;~ setvisible($woodholdernode,0)

$wood = getmesh(@scriptdir &  "\wood.3ds")
$woodnode = addmeshscenenode($wood)
$woodnodetexture = getmaterial ($woodnode,0)
setdiffusecolor($woodnodetexture,0,0,0,0)
setposition($woodnode,0,-40,-9.2)
setscale($woodnode,3,3,3)
setrotation($woodnode,0,180,0)
SetMaterialTexture( $woodNode, 0, GetTexture( @scriptdir & "\white.bmp" ) )
SetMaterialFlag( $woodnode, $EMF_LIGHTING, 0 )
;~ setvisible($woodnode,0)




$x = 0
$y = 0
$z = -20
$xmove = .125
$ymove = .125
$r = 1
While 1
    $x += $xmove
    If $x > 5 Then $xmove = -1/32
    If $x < -5 Then $xmove = 1/32
    $y += $ymove
    If $y > 1 Then $ymove = -1/32
    If $y < -1 Then $ymove = 1/32
        If $y = 0 Then
            $r += 1
            If $r = $i - 1 then $r = 1
            $picture = @scriptdir & "\pics\" & $pic[$r]
            $us[$r] = GetTexture( $picture )
            SetMaterialTexture( $usNode, 0, $us[$r] )
        EndIf
        
        
    setposition($camera,$x,$y,$z)
        $flamecolor = Random(1,3,1)
        If $flamecolor = 1 Then
            setvisible($backflamerednode,1)
            setvisible($frontflamerednode,0)
            setvisible($backflameorangenode,0)
            setvisible($frontflameorangenode,0)
            setvisible($backflameyellownode,0)
            setvisible($frontflameyellownode,1)
        ElseIf $flamecolor = 2 Then
            setvisible($backflamerednode,0)
            setvisible($frontflamerednode,1)
            setvisible($backflameorangenode,1)
            setvisible($frontflameorangenode,0)
            setvisible($backflameyellownode,0)
            setvisible($frontflameyellownode,0)
        ElseIf $flamecolor = 3 Then
            setvisible($backflamerednode,0)
            setvisible($frontflamerednode,0)
            setvisible($backflameorangenode,0)
            setvisible($frontflameorangenode,1)
            setvisible($backflameyellownode,1)
            setvisible($frontflameyellownode,0)
        EndIf
        BeginScene( true, true, 0, 255, 0, 128 )

        SceneDraw( )
        GuiDraw( )

        EndScene( )
    Sleep(30)
WEnd
Func terminate()
    Exit
EndFunc
Edited by youknowwho4eva

Giggity

Link to comment
Share on other sites

The us.bmp is my daughter, ravens defensive lineman Haloti Ngata, and myself.

If you read you'd see that. My daughter (hard to make with a dude), Baltimore Ravins Defensive lineman Haloti Ngata, you know NFL (don't know to many gay guys that watch American Football, probably why you didn't catch the reference). And myself.

its cooL!

Merry F@(kin Christmas Edited by youknowwho4eva

Giggity

Link to comment
Share on other sites

I thought it would take away the 3-D feel if it were straight.

You can make a straight image with 3D sides cant' you? Ahh, I think it's fine anyway. Good job again!

the us picture shows 2 men and a child.. are you gay? or is it a random picture?

A$$H0LE.
Link to comment
Share on other sites

High Five TehWhale. Originally I was thinking of making it sway back and forth, maybe I'll add that. I'm also thinking of making the picture like one of those digital picture frames, you know have a folder and every few minutes it changes the picture. Any idea's or thoughts let me know.

Giggity

Link to comment
Share on other sites

High Five TehWhale. Originally I was thinking of making it sway back and forth, maybe I'll add that. I'm also thinking of making the picture like one of those digital picture frames, you know have a folder and every few minutes it changes the picture. Any idea's or thoughts let me know.

That would be pretty cool. Have the fireplace and above it one of those digital picture frames. But make it like every 4-5 seconds to update the picture from a certain drive or folder. Good job man!
Link to comment
Share on other sites

Just an FYI, if you go into the script and change

$Camera = AddCameraSceneNode( $redbricknode, 7, -3, -17, 0, -15, 0 )

to

$Camera = AddCameraSceneNode( $redbricknode, 0, -3, -20, 0, -15, 0 )

the camera will be straight on. the constrants are ($node,position on x,y,and z, focus on x,y,and z)

I have it focused on the redbricks so its always centered, moved it down 15 so atleast on my screen the top is cut off, and you can see the fire.

or replace the whole thing with this, and float on. I had to move the slat also, when the camera was moving i noticed a gap :)

Moved to first post
Edited by youknowwho4eva

Giggity

Link to comment
Share on other sites

Yeah but then you would see the top of the chimney, and the bottom, unless I put limits on it(kind of a wizard of oz don't pay attention to the man behind the curtain deal). You could always throw that in there. I'm going to delete the script above and put my new script in the first post. With new digital picture frame. All you need is a folder name pics in the scriptdir with your pics in it. I made it only count bmp's so don't put anything else in the folder. I compensated for the thumb.db that xp puts in their so if you don't have that in there change this

If $r = $i - 1 then $r = 1
            $picture = @scriptdir & "\pics\" & $pic[$r]
            $us[$r] = GetTexture( $picture )
            SetMaterialTexture( $usNode, 0, $us[$r] )

to

If $r = $i then $r = 1
            $picture = @scriptdir & "\pics\" & $pic[$r]
            $us[$r] = GetTexture( $picture )
            SetMaterialTexture( $usNode, 0, $us[$r] )

It's line 209.

Edited by youknowwho4eva

Giggity

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...