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.

DarkBASIC Professional Discussion / is this idea possible? :)

Author
Message
noobnerd
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 6th Jan 2011 00:47
hi!
I was thinking on ways of seeing distant planets, stars etc in a 2d environment like the one in my game 2d space. (can bd found in program announcements)
My idea was to somehow render the screen, and everything outside the screen for about 3000pixels on to a 3d plane that would then be viewed from an angle, so that you also sed diatant things, the distant planets would then be resprited properly scaled to their "new location" found by 2d/3d translation of the planets location on the screen on the 3d plane. (so that it wouldnt look flattened and elliptical)

So can anyone tell me if this (or a smarter 2D way to achieve the same results) is code and computing power in thought possible?
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 6th Jan 2011 03:42
You could just scale the sprites factored by your player's distance from them. Also with the distance factor the planets movement. to make it look like your moving, not the planets. So for example if you are x distance away from the planet and your max distance you can be from it is 100 you would have 1.0-(x/100) to be your factor.
Then when you move your player, you could multiply the factor with negative your players movement. So it would be: planetxmovement=-xmovement*factor# to calculate your planets movement to give the allusion the player is moving. Hopefully this answers your question.

My computer surpasses all the technologies of the day. What computer do I have?

Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 6th Jan 2011 07:01
sure, just texture the plane and move it behind, while adding transparency to the plane. Uhh but I would just do what madscientist said. What do you mean about "flattened out and elliptical"?

noobnerd
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 6th Jan 2011 23:34 Edited at: 6th Jan 2011 23:36
what i meant was this, the large image you get with the getimage command (off the screen+surroundings) would be used as a texture for a 3d plane, then a camera would be placed above it at the center (where the player ship is) looking at an angle (resulting in seeing more than what would have been on the screen normaly, also making faraway objects look smaller, and distorted)and rotating as the player rotates ghe ship.

The red sqare is the supposed 3d plane, where the blue thingy is the planet and the yellow thing is something else, see how the planet stretches when viewed from an angle? Is the get image command and the texturing of the plane fast enough to make this a viable method?
Oh and the image is drawn on my phone so no hd
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 7th Jan 2011 09:28
The GET IMAGE command works from points on the active screen, no the camera view, so this method won't work for you.

Malevolence: The Sword of Ahkranox
The infinite RPG
http://swordofahkranox.blogspot.com
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 7th Jan 2011 09:37
Get Image works on the current bitmap, so if you render to a bitmap that isn't visible, then you can grab it using get image.
However, I do not think this is a good way. I would avoid using very large images in general, and get image quickly gets very slow with large images (a full screen grab can make a very visible lag in a game).

What is wrong with using separate plains instead of the images and use DBP's 3D environment?

Cheers!
Sven B

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 7th Jan 2011 11:21
Sven B makes a very good point, actually. I hadn't thought of that. Well done.

But yes, it's true. It is a very inefficient method. You COULD achieve it that way, but it'd be a big kludge and wouldn't run very optimally.

Malevolence: The Sword of Ahkranox
The infinite RPG
http://swordofahkranox.blogspot.com
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 7th Jan 2011 12:22
Instead of getting the image with get image, can't you use set camera to image?

TheComet

Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 7th Jan 2011 12:50
Set Camera To Image would imply using 3D, in which case getting the image wouldn't be necessary. Any 2D commands don't work with Set Camera To Image either.

If you want to draw directly to an image, you can use IanM's MatrixUtils (directing DBP's 2D commands to a render target) or Image Kit (rendering images and effects on render targets). Normal images will be too slow (they can't use the GPU).

Still, using such large images will require a lot of memory. And I actually discourage using them.

Cheers!
Sven B

noobnerd
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 8th Jan 2011 01:12
thx for all the advice
I see now that it isnt an optimal way, the reason i dont want to use the 3D view for real, is because its harder to achieve nice resylts that way i think. rotating an object in 3d requires more code and to make a nice 3D space shooter thats fastpaced easy to use (like my favourite freelancer <3 ) is very hard with my insufficient coding skills i have tried to make the same game in full 3d but it isnt as smooth as the 2d version, also being an indie, making, teturing 3d models and effects is realy time conauming and hard compared to making 2d images

Login to post a reply

Server time is: 2026-07-18 23:14:36
Your offset time is: 2026-07-18 23:14:36