help blitzmovie createcube3d with avi
Übersicht

blitzprogBetreff: help blitzmovie createcube3d with avi |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
hello all
help blitzmovie createcube3d with avi really a nice forum I hope I helped original code link with plug-in http://www.blitzmax.com/Commun...opic=76773 blitzmovie plug in userlib tested ok download link http://utenti.lycos.it/domydar...ted_ok.zip mycode blitzmovie 2d mode help create in 3d mode in a cube3d Code: [AUSKLAPPEN] AppTitle "BlitzMovie Decode To Blitz3D Image Demo (C) 2005 Harriman Software" ; www.harrimansoftware.com/blitzmovie Graphics3D 1024, 768, 32, 1 gr_w = GraphicsWidth() gr_h = GraphicsHeight() SetBuffer BackBuffer() ; init myResizeImage(img,w,h) Global myResizeCamera=CreateCamera() CameraClsMode myResizeCamera,0,1 Global myResizeQuad = CreateQuad() Global myResizeTex = CreateTexture(1024,1024,256 Or 16 Or 32) EntityTexture myResizeQuad, myResizeTex EntityFX myResizeQuad,1 CameraRange myResizeCamera,0.01,100 TranslateEntity myResizeCamera,(1.0/1024.0),-(1.0/1024.0),-1.0 EntityParent myResizeQuad,myResizeCamera,1 ; end of init myResizeImage(img,w,h) movie_to_play$="backfire.avi" .inizio dummy=BLITZMOVIE_Open(movie_to_play$) m_width=BLITZMOVIE_GetWidth() m_height=BLITZMOVIE_GetHeight() BLITZMOVIE_Close() Global image = CreateImage(m_width,m_height) ; create an image that we'll be decoding the movie to ; Open the movie in decode to Blitz3D dx7 surface mode result = BLITZMOVIE_OpenDecodeToImage( movie_to_play$, image, True) If Not result BLITZMOVIE_Close() RuntimeError "Error loading movie! Quitting..." EndIf ; play the movie result = BLITZMOVIE_Play() If Not result BLITZMOVIE_Close() RuntimeError "Error playing movie! Quitting..." EndIf Global width = BLITZMOVIE_GetWidth() Global height = BLITZMOVIE_GetHeight() While BLITZMOVIE_IsPlaying() And (Not KeyHit(1)) Delay 5 dummy=myProjectImage(image,gr_w, gr_h) ;scanlines(gr_h) ; gives a scanline type TV Effect (rem it out to disable it) Flip 1 If KeyDown(30) Then BLITZMOVIE_Stop() If KeyDown(31) Then BLITZMOVIE_Play() If KeyDown(16) Then Goto avicambio Wend BLITZMOVIE_Stop() BLITZMOVIE_Close() FreeImage(image) End Function scanlines(h) Color 0,0,0 w=GraphicsWidth()-1 For i=0 To h Step 4 Rect 0,i,w,3,0 Next End Function Function myProjectImage(img,w#,h#) ; copies an image To a texture of a quad that is placed in front of a cam and then scaled to w,h img_w#=ImageWidth(img) img_h#=ImageHeight(img) If img_w>1024 Then img_w=1024 If img_h>1024 Then img_h=1024 If img_w<1 Then img_w=1 If img_h<1 Then img_h=1 If w>1024 Then w=1024 If h>1024 Then h=1024 If w<1 Then w=1 If h<1 Then h=1 w_rel#=w#/img_w# h_rel#=h#/img_h# g_rel#=1024.0/GraphicsWidth() CopyRect 0,0,img_w,img_h,512-(img_w/2.0),512-(img_h/2.0),ImageBuffer(img),TextureBuffer(myResizeTex) ScaleEntity myResizeQuad,w_rel*g_rel,h_rel*g_rel,0.0001 RenderWorld() End Function Function CreateQuad() ; creates a quad, facing to the right side mesh=CreateMesh() surf=CreateSurface(mesh) v0=AddVertex(surf, -1.0, 1.0,0, 0,0 ) v1=AddVertex(surf, 1.0, 1.0,0, 1,0 ) v2=AddVertex(surf, 1.0, -1.0,0, 1,1 ) v3=AddVertex(surf, -1.0, -1.0,0, 0,1 ) AddTriangle(surf,v0,v1,v2) AddTriangle(surf,v0,v2,v3) UpdateNormals mesh Return mesh End Function .avicambio movie_to_play$="Dragon Blaze.avi" Goto inizio |
||
aletes |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
really nice, but this is a german forum
and: Code: [AUSKLAPPEN] ... Goto inizio ... why Goto? i hate Goto ![]() ys, aletes |
||
blitzprog |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
aletes hat Folgendes geschrieben: really nice, but this is a german forum
and: Code: [AUSKLAPPEN] ... Goto inizio ... why Goto? i hate Goto ![]() ys, aletes because foreigners are not welcome? Italian like me? but I hope I can stay on this board! |
||
![]() |
Smily |
![]() Antworten mit Zitat ![]() |
---|---|---|
no, some people here don't like goto.
that's like a religion. ![]() however, welcome. But if you want to speak english, you better write to the community at http://blitzbasic.com/ . |
||
Lesestoff:
gegen Softwarepatente | Netzzensur | brain.exe | Unabhängigkeitserklärung des Internets "Wir müssen die Rechte der Andersdenkenden selbst dann beachten, wenn sie Idioten oder schädlich sind. Wir müssen aufpassen. Wachsamkeit ist der Preis der Freiheit --- Keine Zensur!" stummi.org |
- Zuletzt bearbeitet von Smily am Di, Mai 05, 2009 14:22, insgesamt einmal bearbeitet
blitzprog |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
like what then?
Perhaps you prefer the functions? but expect more news soon thanks welcome! I like this forum because more and more functional! if not all understand English with google translate from english to german |
||
![]() |
Dice of Darkness |
![]() Antworten mit Zitat ![]() |
---|---|---|
lol ![]() Yes, many users prefer the functions (me too ![]() |
||
Gratis Spiele, Musik, Tools |
aletes |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
no Gosub?
i can't imagined that i always work with Gosub |
||
da_poller |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
if u take function![]() ![]() ![]() what ide u use? (using IDEal?) |
||
![]() |
NightPhoenix |
![]() Antworten mit Zitat ![]() |
---|---|---|
I must agree, functions are much better to handle, believe us blitzprog, pleaseee ![]() And welcome in our smart (and nice) Forum =) Zitat: I like this forum because more and more functional!
Das war ein super Lob an die Mods ![]() |
||
![]() |
Chester |
![]() Antworten mit Zitat ![]() |
---|---|---|
@blitzprog:
The problem with 'goto' is that for many people it's difficult to understand how the code works, if you're jumping around too much. For sure, functions are easier to handle but in my opinion 'goto' is more logical to comprehend from the technical point of view. So i'd say, if one is aware of what he's actually doing why shouldn't he use it? |
||
blitzprog |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
sorry but no one could help me?
code original Code: [AUSKLAPPEN] AppTitle "BlitzMovie Decode To Blitz3D Image Demo (C) 2005 Harriman Software" ; www.harrimansoftware.com/blitzmovie Graphics3D 1024, 768, 32, 1 gr_w = GraphicsWidth() gr_h = GraphicsHeight() SetBuffer BackBuffer() ; init myResizeImage(img,w,h) Global myResizeCamera=CreateCamera() CameraClsMode myResizeCamera,0,1 Global myResizeQuad = CreateQuad() Global myResizeTex = CreateTexture(1024,1024,256 Or 16 Or 32) EntityTexture myResizeQuad, myResizeTex EntityFX myResizeQuad,1 CameraRange myResizeCamera,0.01,100 TranslateEntity myResizeCamera,(1.0/1024.0),-(1.0/1024.0),-1.0 EntityParent myResizeQuad,myResizeCamera,1 ; end of init myResizeImage(img,w,h) movie_to_play$="liebing.avi" dummy=BLITZMOVIE_Open(movie_to_play$) m_width=BLITZMOVIE_GetWidth() m_height=BLITZMOVIE_GetHeight() BLITZMOVIE_Close() Global image = CreateImage(m_width,m_height) ; create an image that we'll be decoding the movie to ; Open the movie in decode to Blitz3D dx7 surface mode result = BLITZMOVIE_OpenDecodeToImage( movie_to_play$, image, True) If Not result BLITZMOVIE_Close() RuntimeError "Error loading movie! Quitting..." EndIf ; play the movie result = BLITZMOVIE_Play() If Not result BLITZMOVIE_Close() RuntimeError "Error playing movie! Quitting..." EndIf Global width = BLITZMOVIE_GetWidth() Global height = BLITZMOVIE_GetHeight() While BLITZMOVIE_IsPlaying() And (Not KeyHit(1)) Delay 5 dummy=myProjectImage(image,gr_w, gr_h) scanlines(gr_h) ; gives a scanline type TV Effect (rem it out to disable it) Flip 1 Wend BLITZMOVIE_Stop() BLITZMOVIE_Close() FreeImage(image) End Function scanlines(h) Color 0,0,0 w=GraphicsWidth()-1 For i=0 To h Step 4 Rect 0,i,w,3,0 Next End Function Function myProjectImage(img,w#,h#) ; copies an image To a texture of a quad that is placed in front of a cam and then scaled to w,h img_w#=ImageWidth(img) img_h#=ImageHeight(img) If img_w>1024 Then img_w=1024 If img_h>1024 Then img_h=1024 If img_w<1 Then img_w=1 If img_h<1 Then img_h=1 If w>1024 Then w=1024 If h>1024 Then h=1024 If w<1 Then w=1 If h<1 Then h=1 w_rel#=w#/img_w# h_rel#=h#/img_h# g_rel#=1024.0/GraphicsWidth() CopyRect 0,0,img_w,img_h,512-(img_w/2.0),512-(img_h/2.0),ImageBuffer(img),TextureBuffer(myResizeTex) ScaleEntity myResizeQuad,w_rel*g_rel,h_rel*g_rel,0.0001 RenderWorld() End Function Function CreateQuad() ; creates a quad, facing to the right side mesh=CreateMesh() surf=CreateSurface(mesh) v0=AddVertex(surf, -1.0, 1.0,0, 0,0 ) v1=AddVertex(surf, 1.0, 1.0,0, 1,0 ) v2=AddVertex(surf, 1.0, -1.0,0, 1,1 ) v3=AddVertex(surf, -1.0, -1.0,0, 0,1 ) AddTriangle(surf,v0,v1,v2) AddTriangle(surf,v0,v2,v3) UpdateNormals mesh Return mesh End Function |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group