Dreamotion3d (and PhysX) continuation...

Advanced game related topics
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post by tmyke »

U/V is Barycentric hit coordinates (not texture coordinate), compared to the selected Face the Entity.
With this parameters, you can find the position Pick in the Entity.
But if you want, I would try to construct a dedicate instruction...
Strength and wisdom.
Image
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Ref: http://www.purebasic.fr/english/viewtop ... c&start=45

Someone came over to the above thread and believes that it's easy to use this engine to create sprite3Ds, with color and all that fun stuff.

Since the instructions are in french ...

Is it possible for someone to create a simple (2 layer, for sample) colored tiling example with this engine?

If it is able to tile a whole screen with multiple layers and not go below 30fps, it might be a contender to the other DX9 system.
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post by tmyke »

A little code with 64 Tiles (2 Texture/Tile 256x256):

http://www.dreamotion3d.com/PureBasic/Tiles.zip

:wink:

PS:And do not be too impatient, English Doc. arrives soon…
Strength and wisdom.
Image
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Ah ha! thank you very much for your help. Thanks for the example and the news on the english portion :) Unfortunately, it doesnt seem like a replacement for sprite3d at all. Way to complicated to do a simple loading of sprite and especially placing and rendering.

Hrm. I guess once I get an interest in creating a 3D product, this would be the way to go. But for 2d, this wouldnt work :oops:

Thanks for the help :)
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

I don't see what is complicated?

DM_Graphics3D(800, 600, 32, 0, 1) to initialize our screen (window or fullscreen in ONE command)

*mysprite2d = DM_LoadSprite2D("myfile.png", 10,10) to load a sprite

DM_BeginScene()
DM_DrawSprite2D(*mysprite2d) to draw our sprite
DM_EndScene()

:roll:
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Actually, according to the sample its the following:

Code: Select all

 *brush = DM_GetBrush(*tile(num) )
  DM_BrushAddTextureStage(*brush, 1, #D3DTSS_COLOROP,   #D3DTOP_BLENDTEXTUREALPHA )
  DM_BrushRestoreTextureStage(*brush, 1, #D3DTSS_COLOROP,   #D3DTOP_MODULATE )
  *texture = DM_GetTexture(*brush, 1)
  DM_LoadTexture(*texture, "road.bmp")
  DM_PositionEntity(*tile(num), i*21-40, j*21-20, 0)

Not simple at all with all those magic numbers in there.

:roll:

And don't forget about the weird location numbers, instead of 0 - width or 0 to height, now we have negatives, oh wonderful!

Code: Select all

  DM_MoveEntity(*camera, 0,20,-150.0)
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

Finally getting more to the details .. and twitches i needed with this... hmm looks promising !

Shannara if you liek it simple stick to sprite 3d or use Supersprite 3d =P

Thalius
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
Cyan
User
User
Posts: 11
Joined: Tue Oct 24, 2006 12:58 pm
Location: Russia
Contact:

Post by Cyan »

tmyke wrote:U/V is Barycentric hit coordinates (not texture coordinate), compared to the selected Face the Entity.
With this parameters, you can find the position Pick in the Entity.
With U/V i find the position 'Pick' to X and Y coord's and with DM_PickedDistance i find Z coord's?
Ex:

Code: Select all

If DM_CameraPick(Camera, X, Y)
      PX = DM_PickedU()
      PY = DM_PickedV()
      PZ = DM_PickedDistance()
      DM_PositionEntity(Decal, PX, PY, PZ)
EndIf
tmyke wrote: But if you want, I would try to construct a dedicate instruction...
Sorry, I have'nt understood this offer :oops:
PureBasic forever!
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post by tmyke »

@Cyan: ;)

@Shannara:
Not simple at all with all those magic numbers in there.
Humm, perhaps... One can certainly improve the things.

For sprite3D with alphablending/multitexture, which syntax would wish to be seen?
Do you have an example directly in PB (with OGL) ?

:) @++ (at Tuesday)
Strength and wisdom.
Image
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Shannara wrote:Actually, according to the sample its the following:

Code: Select all

 *brush = DM_GetBrush(*tile(num) )
  DM_BrushAddTextureStage(*brush, 1, #D3DTSS_COLOROP,   #D3DTOP_BLENDTEXTUREALPHA )
  DM_BrushRestoreTextureStage(*brush, 1, #D3DTSS_COLOROP,   #D3DTOP_MODULATE )
  *texture = DM_GetTexture(*brush, 1)
  DM_LoadTexture(*texture, "road.bmp")
  DM_PositionEntity(*tile(num), i*21-40, j*21-20, 0)

Not simple at all with all those magic numbers in there.

:roll:

And don't forget about the weird location numbers, instead of 0 - width or 0 to height, now we have negatives, oh wonderful!

Code: Select all

  DM_MoveEntity(*camera, 0,20,-150.0)
This part of the example is not to render a sprite, but to modify the 3D terrain to add a road. Camera and all the others things are for 3D, not necessary to use 2D.
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

Please correct my english
http://purebasic.developpez.com/
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

Could you maybe post some screenshots if it's worth, I'm a Mac/Linux User ^^
Chrono Syndrome
Enthusiast
Enthusiast
Posts: 169
Joined: Thu Oct 05, 2006 6:44 am
Contact:

Post by Chrono Syndrome »

Any progress ?
Don't try to catch ze Night !
Remember: 'z' is better zen 'th' =) !
Sorry for bad english.
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post by tmyke »

Beta2 arrives in three or four days...
:wink:
Strength and wisdom.
Image
Chrono Syndrome
Enthusiast
Enthusiast
Posts: 169
Joined: Thu Oct 05, 2006 6:44 am
Contact:

Post by Chrono Syndrome »

And where this beta <_< ?
Don't try to catch ze Night !
Remember: 'z' is better zen 'th' =) !
Sorry for bad english.
Post Reply