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 Discussion / pick screen command question

Author
Message
Plugged
22
Years of Service
User Offline
Joined: 30th Nov 2002
Location: Hertfordshire
Posted: 13th Oct 2005 00:16 Edited at: 13th Oct 2005 01:52
sorry the title is wrong i might the point command, dbc and pro are getting me confused

guys does the point command work on what is currently synced to the screen or if i move some objects first and then use the command will it sow the objects color

as in code

make object 1
color object 1,red
position object offscreen
set background black
sync
move object infront of screen
point center
sync

(first of all i know that won't compile but you can get the idea). would that point return the black from the background or the red from the recently move object. if its the black does any one know how i could do it so i read the red.

cheers
plugged


Work Hard; Play Harder ;
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Oct 2005 01:07
What Pick Screen command?

This is the Dark Basic Classic board you know?

TDK_Man

Plugged
22
Years of Service
User Offline
Joined: 30th Nov 2002
Location: Hertfordshire
Posted: 13th Oct 2005 10:07 Edited at: 13th Oct 2005 18:12
yeah sorry i changed it to the point command, thats what i meant

my problem is that i need to move objects around and check the color at the end of the screen, if is black or white i knew to change the positions of the objects around and then after that sync the screen

cheers
Plugged


Work Hard; Play Harder ;
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Oct 2005 17:21
Point is a 2D command and only works with Images and Bitmaps - not 3D screens.

TDK_Man

blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 13th Oct 2005 18:03 Edited at: 13th Oct 2005 18:04
TDK, that is not correct; 3D is rendered to bitmap 0 (the screen).

Plugged, I would imagine that it works from after the 'sync' command, as that is when the screen is actually properly updated and all 3D instructions finalised... Which is probably a pain, as I imagine you want to render something and then take a couple of pixels without the user seeing it...


[Edit: Ignore this next bit, I didn't read your post properly , but it's fairly important if you're trying to do something similar but not the same.]
Also, 'point' is much slower for a number of pixels than something such as get image, because DBC is an interpreted language.
If I were to say that every command that is executed has to be turned from English into machine code every single time it was run I would be lying, but the truth is not much better.
(It's actually compiled into an 'intermediate' language, probably a series of numbers; Easier to translate than English, but not really that much better.)
Plugged
22
Years of Service
User Offline
Joined: 30th Nov 2002
Location: Hertfordshire
Posted: 13th Oct 2005 18:20
okay my problem is that i want to have a 3d animated character run around a prerendered image(i will refer to this image as the scene image) basically, same as the older final fantasy series. So i was wondering how to do collision no it and i thought i could make a sister image, which would be the small as the scene image except it would be black or white, then i would let the player move the animated model then hide the scene image show the collision image check the new model position and if it was in the black bit move it back to the white bit then hide the collision image and show the scene image. thats why i needed this thread. so if you guys have any other ideas how i can achieve the same result please post it.

note: there will be lots of completing different irregular scene so maths collision would be very hard, and the scene image could be many different colours so i would be hard to might collision on that.

cheers
Plugged


Work Hard; Play Harder ;
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Oct 2005 19:10
Quote: " TDK, that is not correct; 3D is rendered to bitmap 0 (the screen)."


OK, fair enough. What I suppose I should have said was that when I tried to do it a long time ago, I couldn't get it to work.

I'm very surprised to hear that it does now, but at least that's good news!

TDK_Man

Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 13th Oct 2005 21:48 Edited at: 13th Oct 2005 21:49
it does work, but thanks to shading and differing lights you need to check for a color range rather than just the colour you made the object, for example the dark side of a red object has hardly any red, so just checking for a red value of 255 will not work every time, heres an example where a red sphere coloured 255 red gives different results according to how it is lit and where you get the data from, the line shows where you are currently getting the colour data off the object and the actual value is top left...





Tyger software
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 14th Oct 2005 02:07
Wow, tdk man wrong... This, this is terrible! I think I'm going to cry!

Visit my website of games http://www.dabip.co.nr!

Visit http://www.madmanhosting.tk For a GREAT web host visit MAD MAN HOSTING
Plugged
22
Years of Service
User Offline
Joined: 30th Nov 2002
Location: Hertfordshire
Posted: 14th Oct 2005 13:41
okay i think i got it done but the point command also acts as a sync which which is really annoying because i mean the check collision is the last command in the render loop. Which means your character will also go one step in to the object but because of the nature of my program that won't matter. Any way this is a handle piece of code which i thing i will release on code base or code snippet forums, hopefully artists can use it can they can model the character and draw the background.

cheers
Plugged


Work Hard; Play Harder ;
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th Oct 2005 14:46 Edited at: 14th Oct 2005 14:48
If your not moving the background around you could just make a Data Map of all the collisions. Even a 16*16 map, or 32*32. Even if you scroll the background in 2D directions (Up/Down/Left/Right), it will still work with some modifications.

Plugged
22
Years of Service
User Offline
Joined: 30th Nov 2002
Location: Hertfordshire
Posted: 15th Oct 2005 02:41 Edited at: 15th Oct 2005 02:42
hi man thats a good suggestion and might work in most cases but my problem was that the map could be extremely complex and irregular so i would need a very large data map. any way here is the code i am using.



cheers
Plugged


Work Hard; Play Harder ;

Login to post a reply

Server time is: 2025-05-22 13:19:38
Your offset time is: 2025-05-22 13:19:38