[Logo]
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing  
[Register] Register / 
[Login] Login 
3d sprites  XML
Forum Index » Alternativa3D 5
Author Message
vlad


Joined: 05/08/2008 06:20:15
Messages: 13
Offline

I see that you guys have done sprites. I'm trying to do that, now, but I'm having a little difficulty.

Do you guys mind posting some example code for the '3d sprites', or for just plain sprites (billboards), as found shown here:
http://blog.alternativaplatform.com/en/2007/10/05/sprites-3d-sprites/

A little code, such as how to make the sprite face the camera should get me on my way.

If you are unabled, or unwilling, to post a little code, could you give me some direction about how accomplish this?

Thanks

Vlad
makc

[Avatar]

Joined: 02/06/2008 12:19:17
Messages: 1704
Offline

this is obvoiusly unsupported in current version.

@team, coming API overview or any suggestions on how to minimize to-5.1 migration overhead would be great.
[WWW]
vlad


Joined: 05/08/2008 06:20:15
Messages: 13
Offline

Hi makc,

I know this current version doesn't support 'billboards', per se. I'm interested in a way to 'fake' them (make them work however possible) until they are officially supported.

I just don't know what's the best way to get them to work. I don't know if tying them to the actual camera rotation is the best way. I don't know the formula to get that to work, and since the team has already done that, I figure I would ask for sample actionscript code.

~ vlad
makc

[Avatar]

Joined: 02/06/2008 12:19:17
Messages: 1704
Offline

I was thinking about extending SurfaceMaterial and making a surface with single vertex, but the engine might not allow this kind of hack. This needs to be tried though...

This message was edited 1 time. Last update was at 27/08/2008 00:06:25

[WWW]
Joe


Joined: 02/06/2008 03:36:22
Messages: 45
Offline

You could try and port Sandy's Sprite3D class, or even this Papervision3D demo's. Both have the right math.
mike


Joined: 01/06/2008 00:00:06
Messages: 786
Offline

Vlad, here is a sample code which rotates a default plane (the normal of a new created plane is directed along Z axis, "up" vector for the plane is directed along Y axis) so that the plane's normal is always directed to the camera.
makc

[Avatar]

Joined: 02/06/2008 12:19:17
Messages: 1704
Offline

makc   wrote:This needs to be tried though...
Thanks to Anton's help, this worked for me. See below for a link.

This message was edited 2 times. Last update was at 06/09/2008 17:54:27

[WWW]
mariuszkreft


Joined: 04/08/2008 13:12:18
Messages: 10
Offline

Isn't it slow to rotate geometry, especially when you have lot of Sprites?
makc

[Avatar]

Joined: 02/06/2008 12:19:17
Messages: 1704
Offline

that's why I rotate camera instead. it will be only fast when real sprites come out in v6.
[WWW]
mariuszkreft


Joined: 04/08/2008 13:12:18
Messages: 10
Offline

@makc, your sprites are blinking

This message was edited 1 time. Last update was at 05/09/2008 18:31:10

makc

[Avatar]

Joined: 02/06/2008 12:19:17
Messages: 1704
Offline

yep. that's POC code, not really production... but I will try to see what can be done about blinking over the weekend.
[WWW]
wolf

[Avatar]

Joined: 31/05/2008 23:19:38
Messages: 1521
Offline

I found interesting prototype of game with sprites (based on rotating planes):
http://littlemofo.soap.com.au/gamedev/zombie3D/
makc

[Avatar]

Joined: 02/06/2008 12:19:17
Messages: 1704
Offline

makc   wrote:I will try to see what can be done about blinking over the weekend.
blinking problem is now resolved.
[WWW]
mariuszkreft


Joined: 04/08/2008 13:12:18
Messages: 10
Offline

@makc
well done
gjgcomp


Joined: 15/09/2008 05:51:51
Messages: 2
Offline

Hi,

I'm trying to port the Sprite3D class of Sandy to use with my Alternativa scene but this is the error I'm running into:

1067: Implicit coercion of a value of type sandy.core.scenegraph:Sprite3D to an unrelated type alternativa.engine3d.core:Object3D.

The line that it's erroring out on is
which "s" is the Sprite3D variable.


What I did was setup the import of that class via

I see that there's a conflict with Alternativa's core which is understandable, although I'm not sure how to go about porting that class over so it doesn't conflict with the Alternativa engine. Any thoughts?

Thanks
 
Forum Index » Alternativa3D 5
Go to:   
Powered by JForum 2.1.8 © JForum Team