Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
GMS0012
19
Years of Service
User Offline
Joined: 18th Nov 2006
Location:
Posted: 19th Jun 2010 15:07
hi guys
how can I place 2d sprites in a 3d world?
I want to place 2s sprites on a 3d plane (x,y,z coordinates) and make a camera flight through the scene...

is this possible?
thanks
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 19th Jun 2010 15:24
Yeah, it's actually the fastest way to do 2D and holds a lot of benefits.

What I tend to do is SET OBJECT TO CAMERA ORIENTATION on each plain, and that will make it point towards the camera like a sprite - you might have to orientate the plains first though. If the plains aren't orientated properly you can rotate the object, then fix the object pivot so that the correct side of the plain is facing the camera.

I use this for particle effects in propper 3D games too. If you are making a totally 2D game, like a sidescrolling platform game for instance, you might not have to orientate the plains at all, as they might already be facing the camera.


Health, Ammo, and bacon and eggs!
GMS0012
19
Years of Service
User Offline
Joined: 18th Nov 2006
Location:
Posted: 19th Jun 2010 16:16
can you give a short code example of how to do it?
this would be great
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 20th Jun 2010 01:22
The plain allways is faced to camera position.I didn`t add texture to it so idk if it`s facing the right way or not.Just get this and expand it the way VanB suggested.This is really cheap trick using primitives like plains instead of many low poly objects.I`ve seen this used for plants, flowers or three leafs.



This is basic example to see the concept.I hope this is what you are looking for.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 20th Jun 2010 05:14 Edited at: 20th Jun 2010 15:25
Sidescrolling (Parallax Scrolling ish) Concept:



A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
GMS0012
19
Years of Service
User Offline
Joined: 18th Nov 2006
Location:
Posted: 20th Jun 2010 12:26
thanks guys

how can i set the position of a sprite on a place?
is there a z coordinate?
Coldfire
17
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 20th Jun 2010 13:21
There isn't a z coordinate for sprites, but you can change their priority with 'SET SPRITE PRIORITY Sprite Number, Priority.' The higher you set the priority, the farther in back it will be drawn.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 20th Jun 2010 14:44 Edited at: 20th Jun 2010 14:44
Can you please clarify what type of game your making so I (we) can give you the right advice. It sound's like 2.5d at the moment, but since there's many 2.5d techniques, I want to narrow it down first.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
GMS0012
19
Years of Service
User Offline
Joined: 18th Nov 2006
Location:
Posted: 20th Jun 2010 18:14 Edited at: 20th Jun 2010 18:31
hi.

yes. should be like a 2.5d game.
i want to have a plane and position my sprites on it. (with a 90degree angle to the surface).
i want to place some sprites in the foreground.. some in the background.. (like layers)

and i want to move the camera that i could look "between" the "layers".

perhaps i will use some 3d boxes where my sprite should walk on.
can i use collision checks between 2d sprites and my 3d boxes?
so i have a 3d environment with 2d characters.. this looks intersting for my idea i have in mind.

can i use physic effects on both (3d boxes and 2d sprites)?

I hope ou guys can help me.

thanks

edit:
I dont want to use billboards because they are always faced to the camera
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 20th Jun 2010 18:45 Edited at: 20th Jun 2010 18:45
Quote: "I dont want to use billboards because they are always faced to the camera"


Now I'm confused...

The easiest way to explain what you want and believe me to save time, is tell me the name(s) of a game that does what you want, I can Youtube it if I haven't played it already and then help you. Because it sound's like you want and don't want 2d sprites at the moment.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
GMS0012
19
Years of Service
User Offline
Joined: 18th Nov 2006
Location:
Posted: 20th Jun 2010 19:17
LOL

i cant give you an example.. or perhaps this..
do you know the playstation game "little big planet"
i want to do some kind of this.

with a 3d terrain (boxes and so on) BUT with 2d charaters...
i want to make phyisical hints and....

i want to move in this world free with my camera..
do you know what i am talking about..

http://us.playstation.com/games-and-media/games/littlebigplanet-2-ps3.html


so i need to know how i can place my sprites in a 3d scene and check collisions between them and add physical effects to all.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 20th Jun 2010 19:30
Aha, like that, now I get it, really interested in what they will do with LittleBigPlanet 2, but anyway...

I think we don't even need sprite for this, should be all 3d, plus you have way more control over 3d. The 2d character will just be 3d plain aligned with the camera plain but not facing the actual camera position. I'm going to quickly make an example to see if I got the right thing, then we can tweak it to your liking.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
GMS0012
19
Years of Service
User Offline
Joined: 18th Nov 2006
Location:
Posted: 20th Jun 2010 20:07 Edited at: 20th Jun 2010 21:09
hi.. but i need 2d models..
i want to make it with 2d models..
this should be pretty cool (what i have in mind)

by the way: can I build a level editor with DB where I can edit the properties of the objects.
i need input boxes where i enter the values for scaling the object or something like this. can DB handle this?
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 20th Jun 2010 22:01 Edited at: 20th Jun 2010 23:32
2d models = 3d models with 0 depth
DBP editor = Yes, look into GUI's

Going off LittleBigPlanet, I quickly put this together, though not that bad for a proof of concept. Anyway, here it is:



A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
GMS0012
19
Years of Service
User Offline
Joined: 18th Nov 2006
Location:
Posted: 21st Jun 2010 15:15
thanks for the code... i will test it today.

can you recommend me a simple program for making characters and animations.
i am no artist ...
Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 21st Jun 2010 22:55
Quote: "can you recommend me a simple program for making characters and animations"

CharacterFx - it's free and quite simple for a beginer

GMS0012
19
Years of Service
User Offline
Joined: 18th Nov 2006
Location:
Posted: 23rd Jun 2010 21:55
Sasuke,
I checked the code today. thanks a lot

Login to post a reply

Server time is: 2026-07-25 08:30:13
Your offset time is: 2026-07-25 08:30:13