It is currently Sat Oct 19, 2019 1:47 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 141 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next
Author Message
 Post subject: Dreamotion3d (and PhysX) continuation...
PostPosted: Sat Oct 14, 2006 12:44 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Sep 29, 2006 1:10 pm
Posts: 132
Location: France
Dreamotion3D (and the Physic module) is a Blitz3D like 3D engine, in Beta-Test'.
Developed with DIrectX9c, DM3M is designed to allow fast and easy implementation
with a simple set of instructions.
the development continues, and the first release version should arrive at the beginning
of year 2007, with several news (shadows, best terrain engine, new format supported, etc...)

Physic doc is in English, but graphical engine doc is still in French (coming soon in English)
PureBasic 4.00 and Direct9c instelled it's nescessery...

If you want try it, and (why not) become beta-tester ...

link Pure Basic v0.2.04
http://www.dreamotion3d.com section dowload (only for register user)

Image

_________________
Strength and wisdom.
Image


Last edited by tmyke on Fri Feb 02, 2007 3:30 pm, edited 5 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Oct 14, 2006 12:47 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Sep 29, 2006 1:10 pm
Posts: 132
Location: France
@Psychophanta:
...
you can also put the DLL in the 'Compiler' folder, I try it, and it's good...
... or in your sample folder, but with an executable .

:wink:

_________________
Strength and wisdom.
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Oct 14, 2006 3:15 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat May 17, 2003 11:31 am
Posts: 6068
i admit these screenshots look good...

_________________
( PB5.xx Win10 x64 Asrock AB350 Pro4 Ryzen 1600X 32GB RAM Evo 840 GTX1060 )
( The path to enlightenment and the PureBasic Survival Guide right here... )


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Oct 14, 2006 4:58 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1793
Location: Pas-de-Calais, France
Please give it a try! It's the best engine available for a while. Samples are : :shock: , and Tmyke is available to help. :D


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Oct 14, 2006 8:42 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Aug 19, 2003 11:36 am
Posts: 1418
Location: Doubs - France
Yes it's great, i'm playing with it.

Here a small example to create a mesh and texture manual, i needed this example for my own code :)


Code:
;////////////////////////////////////////////////////////////////
;//
;// Project Title: Dreamotion3D pour PureBasic
;// File Title: MESH MANUEL & TEXTURE MANUELLE
;//           
;// Created On: 12-10-2006
;// Conversion Author: Terry Myke
;//
;////////////////////////////////////////////////////////////////

; Fichiers Include
IncludePath "Include\"
IncludeFile "d3dx9.pbi"
IncludeFile "dreamotion3d.pbi"     

Declare CreateCube()

Global  *camera.CEntity
Global  *entity.CEntity
Global  *brush.CBrush
Global  *texture.CTexture
Global  *font.CFont

;Initialisation des différents modules
If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
  End
EndIf

;ouvre un ecran 3D
DM_Graphics3D(800, 600, 32,  1, 1)
*font = DM_LoadFont( "Arial",16, 2)

;creation du cube
CreateCube()

;--------------------------------------------------------------
; UNE PETITE CAMERA POUR VOIR NOTRE SCENE
;--------------------------------------------------------------
*camera = DM_CreateCamera(#Null)
DM_MoveEntity(*camera, 0, 0, -50)
DM_CameraClsColor(*camera, 25, 25, 25)

Repeat

  ExamineKeyboard()
  DM_TurnEntity(*entity,1,1,1)

  ;debut rendu
  DM_BeginScene()
  ;rendu scene
  DM_Renderworld()
  ;fin rendu
  DM_EndScene()

Until KeyboardPushed(#PB_Key_Escape)
DM_ClearGraphics()
End

Procedure CreateCube()
  ;creation d'un mesh vide, un canal de texutre,
  ;12 faces, 24 vertices, 1 surface, pas de parent
  *entity = DM_CreateMesh(12, 24, 1, #Null)
  ;les vertex
  Restore Vertex
  For i= 0 To 23
    Read x.f
    Read y.f
    Read z.f
    Read u.f
    Read v.f
    ;les coordonnées de vertex
    DM_VertexCoords(*entity, i, x, y, z)
    ;les coordonnées de texture (canal 0)
    DM_VertexTexCoords(*entity, i, 0, u, v)
  Next i
  ;les triangles
  Restore Indice
  For i = 0 To 11
    Read v1.l
    Read v2.l
    Read v3.l
    DM_VertexTriangle(*entity, i, v1,v2,v3, 0)
  Next i
  ;on crée une petite Brush, dont on récupère le pointeur
  *brush = DM_CreateBrush("cube")
  ;modifie certains paramètres de la brush
  DM_BrushAmbient(*brush, 255,128,0,255)
  DM_BrushDiffuse(*brush, 255,128,0,255)
 
  ;--------------------------------------------------------
  ; TEXTURE
  ;--------------------------------------------------------
  ;creation d'une texture vide de 256x256
  *texture = DM_CreateTexture(256,256)
  ;ré-oriente le buffer de sortie graphique vers notre texture
  DM_SetBuffer(*texture)
  ;debut d'un rendu
  DM_BeginScene()
    DM_ClsScreen (210, 0, 255, 0)         ; efface le buffer avec une couleur
    DM_DrawRect  ( 10, 10, 200, 200)      ; dessin d'un rectangle 2D
    DM_SetColor2D(222, 0, 0, 255)         ; change couleur du trait
    DM_DrawOval  (100, 100, 50, 50)       ; dessin oval 2D
    DM_DrawText(*font, 10, 15, "TEXTURE") ; un petit texte
  ;fin rendu
  DM_EndScene()
  ;de nouveau le buffer vers l'ecran
  DM_SetBuffer(#Null)
 
 
  DM_BrushTexture(*brush, *texture, 0)
  ; modifie l'état de rendu de la Brush pour voir de tous les cotés
  DM_BrushAddRender(*brush, #D3DRS_CULLMODE, #D3DCULL_NONE)
  ; affecte la brush créee a notre entity
  DM_PaintEntity(*entity, *brush, 0)
  ; génératon auto des normales de l'entity créée
  DM_UpdateNormal(*entity)
  ; p'tite rotation
  DM_RotateMesh(*entity, 0, 45, 0)

EndProcedure


DataSection
Vertex:
; liste des 24 vertex avec leurs coordonnées de textures
Data.f -10, 10,-10, 1, 0
Data.f  10, 10,-10, 1, 1
Data.f -10,-10,-10, 0, 0
Data.f  10,-10,-10, 0, 1
Data.f -10, 10, 10, 0, 0
Data.f -10,-10, 10, 0, 1
Data.f  10, 10, 10, 1, 0
Data.f  10,-10, 10, 1, 1
Data.f -10, 10, 10, 0, 0
Data.f  10, 10, 10, 0, 1
Data.f -10, 10,-10, 1, 0
Data.f  10, 10,-10, 1, 1
Data.f -10,-10, 10, 1, 0
Data.f -10,-10,-10, 1, 1
Data.f  10,-10, 10, 0, 0
Data.f  10,-10,-10, 0, 1
Data.f  10, 10,-10, 0, 0
Data.f  10, 10, 10, 0, 1
Data.f  10,-10,-10, 1, 0
Data.f  10,-10, 10, 1, 1
Data.f -10, 10,-10, 1, 0
Data.f -10,-10,-10, 1, 1
Data.f -10, 10, 10, 0, 0
Data.f -10,-10, 10, 0, 1
Indice:
;liste des faces
Data.l  0,  1,  2
Data.l  1,  3,  2
Data.l  4,  5,  6
Data.l  5,  7,  6
Data.l  8,  9, 10
Data.l  9, 11, 10
Data.l 12, 13, 14
Data.l 13, 15, 14
Data.l 16, 17, 18
Data.l 17, 19, 18
Data.l 20, 21, 22
Data.l 21, 23, 22
EndDataSection

_________________
Please correct my english
http://purebasic.developpez.com/


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Oct 15, 2006 3:12 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Sep 29, 2006 1:10 pm
Posts: 132
Location: France
... and Just load a B3D entity...

Code:
IncludePath "Include\"
  IncludeFile "d3dx9.pbi"
  IncludeFile "dreamotion3d.pbi"

  Global   *camera.CEntity
  Global   *mesh.CEntity

  ;  first init
  If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
    End
  EndIf
  ;-------------------
  ; 3D engine init
  ;-------------------
  DM_Graphics3D(800, 600, 32,  0, 1)
  SetCurrentDirectory("media/")

  ;------------------------
  ; load a B3D file
  *mesh = DM_LoadEntity("harvester.b3d", #Null, #False)
  ; ------- little camera
  *camera = DM_CreateCamera(#Null)
  DM_TranslateEntity(*camera,  0,5,-30)
  DM_CameraClsColor(*camera, 25, 25, 25)
  ;-----------------------------
  ; ------- main loop --------
 ;------------------------------
  Repeat
     ExamineKeyboard()
     If KeyboardReleased(#PB_Key_Escape) Or WindowEvent()=#PB_Event_CloseWindow
       Quit=1
     EndIf
     ; ---------------
     ;      Render
     ; ---------------
     DM_BeginScene()
       DM_RenderWorld()
     DM_EndScene()
     ; little rotation entity for demo
     DM_TurnEntity(*mesh, 0,1,0)
  Until Quit=1
  DM_ClearGraphics()
  End


:wink:

_________________
Strength and wisdom.
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Oct 15, 2006 4:45 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Oct 31, 2004 10:54 am
Posts: 760
Location: France
@Comtois

" ligne 62 DM_CreateMesh : incorrect number of parameters" :?

_________________
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Oct 15, 2006 4:55 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Sep 29, 2006 1:10 pm
Posts: 132
Location: France
dobro wrote:
@Comtois

" ligne 62 DM_CreateMesh : incorrect number of parameters" :?


Download the last beta , at home, with it, it's good ... :wink:

_________________
Strength and wisdom.
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 16, 2006 5:34 am 
Offline
Addict
Addict

Joined: Mon May 29, 2006 1:01 am
Posts: 1965
Location: Outback
:shock:

Awesome

_________________
Dare2 cut down to size


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 16, 2006 5:36 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 02, 2003 9:16 am
Posts: 2092
Location: Germany
Where did you get the PhysX chipset?

_________________
bye,
Daniel


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 17, 2006 11:19 am 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4578
Location: Spa, relaxing and thinking, and learning...
These are is a great news!
Thanks you!

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 17, 2006 11:58 am 
Offline
Addict
Addict
User avatar

Joined: Wed Oct 15, 2003 12:40 am
Posts: 1126
Location: Sweden
Great! Now I can begin my work on the MMORPG called "World of PureCraft"... :wink:

_________________
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 17, 2006 6:07 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Oct 30, 2003 11:19 pm
Posts: 1808
Location: Emerald Cove, Unformed
I noticed the title said PhysX, do we require the PhysX card installed on our computers to run these demos? Or will the demos automatically detect whether that card is installed or not?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 18, 2006 4:22 pm 
Offline
User
User
User avatar

Joined: Thu Feb 16, 2006 9:35 am
Posts: 68
Location: Russia
tmyke wrote:
... and Just load a B3D entity...

Code:
IncludePath "Include"
  IncludeFile "d3dx9.pbi"
  IncludeFile "dreamotion3d.pbi"

  Global   *camera.CEntity
  Global   *mesh.CEntity

  ;  first init
  If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
    End
  EndIf
  ;-------------------
  ; 3D engine init
  ;-------------------
  DM_Graphics3D(800, 600, 32,  0, 1)
  SetCurrentDirectory("media/")

  ;------------------------
  ; load a B3D file
  *mesh = DM_LoadEntity("harvester.b3d", #Null, #False)
  ; ------- little camera
  *camera = DM_CreateCamera(#Null)
  DM_TranslateEntity(*camera,  0,5,-30)
  DM_CameraClsColor(*camera, 25, 25, 25)
  ;-----------------------------
  ; ------- main loop --------
 ;------------------------------
  Repeat
     ExamineKeyboard()
     If KeyboardReleased(#PB_Key_Escape) Or WindowEvent()=#PB_Event_CloseWindow
       Quit=1
     EndIf
     ; ---------------
     ;      Render
     ; ---------------
     DM_BeginScene()
       DM_RenderWorld()
     DM_EndScene()
     ; little rotation entity for demo
     DM_TurnEntity(*mesh, 0,1,0)
  Until Quit=1
  DM_ClearGraphics()
  End


:wink:

And how animate B3D Entity???

And well to put parameters by default in import
For example:
Code:
DM_LoadEntity.l (filename.s, *parent. CEntity = #Null, lod.c = #False)

_________________
Sorry my English, I'm Russian
AMT Laboratory


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 18, 2006 8:28 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Aug 19, 2003 11:36 am
Posts: 1418
Location: Doubs - France
@Psychophanta, do you remember this one ? :)

Code:
; Fichiers Include
IncludePath "Include\"
IncludeFile "d3dx9.pbi"
IncludeFile "dreamotion3d.pbi"     


Global *camera.CEntity
Global *brush.CBrush
Global *texture.CTexture
Global *entity.CEntity
Global *font.CFont
Global *light.CEntity


; Initialisation des différents modules
If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
  End
EndIf
; ouvre un ecran 3D
DM_Graphics3D(800, 600, 32,  1, 1)

;-camera
*camera = DM_CreateCamera(#Null)
DM_MoveEntity(*camera, 0,0,-50)
DM_CameraClsColor(*camera, 0, 0, 0)

;-Light
DM_AmbiantLight(65,  65,  65)
*light = DM_CreateLight(1, #Null)
DM_TurnEntity(*light, 90,0,0)

;-font
*font = DM_LoadFont( "Arial", 36, 2)

;-Constantes
#NbX=30 ; nombre de facettes
#NbZ=30 ; nombre de facettes
#DegConv=3.14159265/180

;-Variables Globales
Global AngleVague.f,WaveFrequency.f,WavePeriodX.f,WavePeriodZ.f,WaveAmplitude.f
Global xrot.f,yrot.f,zrot.f
Global CamLocateX.l,CamLocateY.l,CamLocateZ.l,CamLookAtX.l,CamLookAtY.l,CamLookAtZ.l
Global Mode.b
circle.l=360
AngleVague=Random(circle)
WaveFrequency=3;=waves/second
WavePeriodX=5;=1/Wave lenght
WavePeriodZ=9;=1/Wave lenght
WaveAmplitude=4
xrot=-0.3:yrot=-0.4:zrot=0.2
CamLocateX.l=0:CamLocateY.l=0:CamLocateZ.l=50
CamLookAtX.l=0:CamLookAtY.l=0:CamLookAtZ.l=0

;-Procédures
Procedure Matrice()
  ;creation d'un mesh vide
  *entity = DM_CreateMesh((#NbX)*(#NbZ)*4, (#NbX+1)*(#NbZ+1), 1, #Null)
  i = 0

  For b=0 To #Nbz
    For a=0 To #NbX
      ;les coordonnées de vertex
      DM_VertexCoords(*entity, i, a - #NbX/2, 0, b - #Nbz/2)
      ;les coordonnées de texture (canal 0)
      DM_VertexTexCoords(*entity, i, 0, a/#NbX, b/#Nbz)
      i + 1
    Next a
  Next b

  i = 0
  Nb=#NbX+1
  For b=0 To #NbZ-1
    For a=0 To #NbX-1
      P1=a+(b*Nb)
      P2=P1+1
      P3=a+(b+1)*Nb
      P4=P3+1
      ;Face 1
      DM_VertexTriangle(*entity, i, P3, P2, P1, 0)
      i + 1
      DM_VertexTriangle(*entity, i, P2, P3, P4, 0)
      i + 1     
    Next
  Next
 
    ;on crée une petite Brush, dont on récupère le pointeur
  *brush = DM_CreateBrush("cylindre")
  ;modifie certains paramètres de la brush
  DM_BrushAmbient(*brush, 255,255,255,255)
  DM_BrushDiffuse(*brush, 255,255,255,255)
 
  ;--------------------------------------------------------
  ; TEXTURE
  ;--------------------------------------------------------
  ;creation d'une texture vide de 256x256
  *texture = DM_CreateTexture(256,256)
  ;ré-oriente le buffer de sortie graphique vers notre texture
  DM_SetBuffer(*texture)
  ;debut d'un rendu
  DM_BeginScene()
        DM_ClsScreen (210, 0, 255, 0)         ; efface le buffer avec une couleur
    DM_DrawRect  ( 1, 1, 254, 254)      ; dessin d'un rectangle 2D
    DM_DrawRect  ( 10, 10, 200, 200)      ; dessin d'un rectangle 2D
    DM_SetColor2D(222, 0, 0, 255)         ; change couleur du trait
    DM_DrawOval  (100, 100, 50, 50)       ; dessin oval 2D
    DM_DrawText(*font, 10, 15, "TEXTURE") ; un petit texte
  ;fin rendu
  DM_EndScene()
  ;de nouveau le buffer vers l'ecran
  DM_SetBuffer(#Null)
 
 
  DM_BrushTexture(*brush, *texture, 0)
  ; modifie l'état de rendu de la Brush pour voir de tous les cotés
  DM_BrushAddRender(*brush, #D3DRS_CULLMODE, #D3DCULL_NONE)
  ; affecte la brush créee a notre entity
  DM_PaintEntity(*entity, *brush, 0)
  ;génératon auto des normales de l'entity créée
  DM_UpdateNormal(*entity)
 
EndProcedure

Procedure vagues()
 ; Modification sur l'axe des Y
  i = 0
  For z=0 To #NbZ
    For x=0 To #NbX
       y.f=Sin(#DegConv*(AngleVague+x*WavePeriodX+z*WavePeriodZ))*WaveAmplitude
      DM_VertexCoords(*entity, i, DM_VertexX(*entity, i), y, DM_Vertexz(*entity, i))
      i + 1
    Next
  Next
  ;génératon auto des normales de l'entity créée
  ;DM_UpdateNormal(*entity) ; work very fine but it's slow ?
EndProcedure


;-Mesh
Matrice()


;-Boucle principale
Repeat
  ExamineKeyboard()
 
  ;Calculate (AngleVague+WaveFrequency)%360: (coz % operand doesn't accept floats)
  !fild dword[v_circle]
  !fld dword[v_AngleVague]
  !fadd dword[v_WaveFrequency]
  !fprem
  !fstp dword[v_AngleVague]
  !fstp st1
 
  vagues()
  DM_TurnEntity(*entity, xrot, yrot, zrot)
  ;debut rendu
  DM_BeginScene()
  ;rendu scene
  DM_Renderworld()
  ;fin rendu
  DM_EndScene()

Until KeyboardPushed(#PB_Key_Escape)
DM_ClearGraphics()
End

_________________
Please correct my english
http://purebasic.developpez.com/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 141 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye