Page 1 of 2

3D Sprite addons

Posted: Wed Jul 02, 2008 6:21 am
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!! :)

Posted: Wed Jul 02, 2008 8:28 am
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!

Posted: Wed Jul 02, 2008 2:02 pm
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.

Posted: Wed Jul 02, 2008 2:09 pm
by djes
Coz of the "square" necessity?

Posted: Wed Jul 02, 2008 2:28 pm
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:

Posted: Wed Jul 02, 2008 3:32 pm
by djes
Oh, I see, bad read.
+1 for this request :)

Posted: Wed Jul 02, 2008 6:07 pm
by Hroudtwolf
+1

Posted: Wed Jul 02, 2008 10:23 pm
by DoubleDutch
+1 (hopefully for 4.3)

Posted: Wed Jul 02, 2008 10:27 pm
by eddy
+1

Posted: Thu Jul 03, 2008 2:19 am
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?

Posted: Thu Jul 03, 2008 8:01 am
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).

Posted: Thu Jul 03, 2008 2:45 pm
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.

Posted: Thu Jul 03, 2008 3:10 pm
by djes
We can do (sort of) that with ogre (with uv mapping) , actually, but it need a bit of work.

Posted: Thu Jul 03, 2008 3:19 pm
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.

Posted: Thu Jul 03, 2008 3:54 pm
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.