3D Sprite addons

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
zxtunes.com
Enthusiast
Enthusiast
Posts: 375
Joined: Wed Apr 23, 2008 7:51 am
Location: Saint-Petersburg, Russia
Contact:

3D Sprite addons

Post by zxtunes.com »

Current realization 3D Sprites very much is not optimum and not convenient.

Superfluous memory is spent and instead of 1-st texture I am compelled to create them much much.

SDL, HGE, and any modern simple graphic engines already for a long time allow to deduce not all textures entirely as in PureBasic and only its fragment.

And this very much does not suffice in PB.

I am assured that realization not such complex.


I suggest it to realize for example here so:

Code: Select all

LoadSprite(0, "texture.png", #PB_Sprite_Texture)
CreateSprite3D(0,0, x,y, w,h)
; x - x coordinates sprite on textures
; y - y coordinates sprite on textures
; w - width sprite from textures
; h - height sprite from textures

This All!! :)
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Why don't you do this yourself? It's not so hard! When you'll have to code a game, you'll need to create much more complicated functions!
User avatar
zxtunes.com
Enthusiast
Enthusiast
Posts: 375
Joined: Wed Apr 23, 2008 7:51 am
Location: Saint-Petersburg, Russia
Contact:

Post by zxtunes.com »

djes wrote:Why don't you do this yourself? It's not so hard! When you'll have to code a game, you'll need to create much more complicated functions!
It no possibly in PureBasic today.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Coz of the "square" necessity?
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

djes wrote:Coz of the "square" necessity?
No because you'd have to hack the internals of purebasic to get this in a useful way. :wink:
bye,
Daniel
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Oh, I see, bad read.
+1 for this request :)
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

+1
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

+1 (hopefully for 4.3)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

+1
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Post by Demivec »

I'm confused (due to the languaged used), what is being requested? :?

Is it a function to create a 3D sprite from a clipped 2D sprite? Or is it to create a non-square 3D sprite? Or is it something else?
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Demivec wrote:I'm confused (due to the languaged used), what is being requested? :?

Is it a function to create a 3D sprite from a clipped 2D sprite? Or is it to create a non-square 3D sprite? Or is it something else?
He wants something like ClipSprite3D ;-) (He just made it statical through a few more parameters in CreateSprite3D).
bye,
Daniel
User avatar
zxtunes.com
Enthusiast
Enthusiast
Posts: 375
Joined: Wed Apr 23, 2008 7:51 am
Location: Saint-Petersburg, Russia
Contact:

Post by zxtunes.com »

Demivec wrote:I'm confused (due to the languaged used), what is being requested? :?

Is it a function to create a 3D sprite from a clipped 2D sprite? Or is it to create a non-square 3D sprite? Or is it something else?
I need 1 texture = much sprites.

See illustration:

1 texture = 65 sprites.

Greater economy memory, rare switching of textures = so faster put, etc.

Image

Example:

Code: Select all

LoadSprite(0, "texture.png", #PB_Sprite_Texture) 

CreateSprite3D(0,0, 409, 0, 61, 68)
CreateSprite3D(1,0, 2, 1, 47, 44)
CreateSprite3D(2,0, 52, 1, 45, 44)
CreateSprite3D(3,0, 100, 1, 51, 44)
CreateSprite3D(4,0, 293, 1, 24, 27)
CreateSprite3D(5,0, 155, 2, 43, 43)
CreateSprite3D(6,0, 200, 2, 43, 43)
CreateSprite3D(7,0, 245, 2, 43, 43)
CreateSprite3D(8,0, 349, 4, 56, 87)
CreateSprite3D(9,0, 473, 9, 36, 36)

... etc
Now everyone sprite NOT SQUARE, and rectangular also undertakes from one texture (it important), it not automatic clipping texture from a texture as who that could think.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

We can do (sort of) that with ogre (with uv mapping) , actually, but it need a bit of work.
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

We can also do it with sprite 2D :wink: (ClipSprite). But he wants to separate those sprites. He wants an sprite ID for each of those fields and he wants it to be in sprite 3D. Well, I think the first isn't necessary but the second: ClipSprite3D.
bye,
Daniel
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

He can code procedures creating and copy/pasting regular sprites, and converting them in 3d, but it will be memory and time consuming.
Post Reply