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.

Newcomers DBPro Corner / 2d images (Not Sprites) and 3d objects in the same world.

Author
Message
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 6th Feb 2013 19:22
I am having difficulty in showing both 2d images AND 3d objects. I do not want to use sprites for everything (for example my GUI is a png) and i dont want to texture planes as i am already doing that with other things.

I want to know if there is a way to display 2d images AND sprites if i want them, plus 3d objects even if they are textured.

All i have found out so far is that depending on where the sync is called it either displays 3d only or 2d only. I tried searching but i am not typing in the right search question as everything i type comes up with no results like 2d images over 3d.

Thanks.
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 6th Feb 2013 20:35
i think you can paste images and text after all 3d drawing and immediately before sync should work. if you draw any 3d after 2d, the 2d will get cleared. something like.

do
process logic
update 3d
update sprite
update 2d
sync
loop

Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 6th Feb 2013 20:49
Yeah i have tried that order, i even put everything in separate functions to make sure i was doing everything in the loop in the correct order but still no luck. It just displays the 2D, i.e text and my png and button graphics but will only switch completely over to 3d (unfortunately removing the 2d stuff) when i "Grab" the top bar of the window and move it.

Not really sure what to do. Im sure you can do both 2d and 3d on the same screen though, im sure ive seen it done.
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 6th Feb 2013 20:51
Try using PASTE IMAGE?

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Feb 2013 21:10
This is interesting...

I was wondering how that Update 1,2,3,sync part worked...

Ignore me for now, just tagging in to see how this develops

Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 6th Feb 2013 21:17 Edited at: 6th Feb 2013 21:18
Ok i have it pasting everything by making a very very simple test program with the bare basics but it flickers like an all night rave unless you add sync on then it just displays 2d so something is off.



I know i have not added sprites into the mix yet, but i am trying one thing at a time.

Edit: Zero, i always use paste image, not sure if this is right or wrong but i dont know other ways to display the images so this is all i use.
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 6th Feb 2013 21:27 Edited at: 7th Feb 2013 06:22
Paste image is nice. I never use sprites.

I would rearrange the code as such:


Sprites definitely have benefits such as animation. I'm pretty sure they are just 3d textured plains aligned to the camera internally by using a projection matrix and world coordinates, etc.

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 6th Feb 2013 22:57
Not only does this work perfectly but because of the vast amount of commenting i actually learned a hell of a lot in that little snippet.
Stuff that just isn't obvious to people like me.

Thank you so much.
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 6th Feb 2013 23:43
I've picked up a little bit here and there while lurking the forums, so I'm glad my lurking is not in vain! I'm just excited to see what you've got in the works; seems like you've been at it pretty hard! Plus, I'm a huge RTS/SimCity/ANNO fan.

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 7th Feb 2013 19:38
Well zero, all i am doing at the moment is trying to learn little snippets of code that are RTS based. So im just throwing out questions that will hopefully teach me some functions and methods and help me understand things like how a game is put together better. But what i really really want to do further down the line is something that is a sort of cross between Game of Thrones and Lord of the Rings based fantasy medieval, mixed with bits of settlers, total war and possibly black and white. Not all of these things at once of course, just little ideas and themes from each.

Its far from an original concept but over time i think i could make something fun to play. What i want to focus on is relationships between factions so diplomacy will hopefully be a bit more detailed than most games with backstabbing, arse kissing, trecherous sly moves and noble intentions all getting in the way of who is doing what and where in the world. I also want the game a considerably more slower paced than most rts's.
It usually takes less than a minute to build a house in most games but i want it to take days (in game) as it would, even though the game time would not match real world.

Its all going to be based on a short story i wrote a while ago for a character where i accidently ended up going a bit too far and wrote way too much for a character background that it almost ended up being a book

The best way for me to learn i have found is to hammer out bits here and there, like think of something i want to do, try to code it, fail because i dont know enough, come here, get answers sort it out and then just "bank" the info and knowledge. Then take a nice break and come back to it and do some more. Eventually i will build up enough knowledge to undertake a decent sized project i hope but for now im still in the "ask questions every five minutes" stage

Login to post a reply

Server time is: 2024-11-27 10:13:15
Your offset time is: 2024-11-27 10:13:15