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.

Dark GDK / A Few questions i have. can you help please?

Author
Message
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 13th Jan 2010 11:23
ok, i have a few questions that i need answering.

ok here they are

1 -> How do i draw a transparent box of that can be any size?
2 -> how do i find the 3d point of when the camera is looking when this line of sight hits and object?
3 -> Getting part of string (example: 10|15|32|) how do i get those three parts?
4 -> how cam i find a x2 point from x1 of length L in direction of D on the X Axis?

i rather post all my questions here than flood the forum.
hope you can hlep with one of them or more.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Aldur
16
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 13th Jan 2010 11:40 Edited at: 13th Jan 2010 11:40
1. 2D or 3D?
2. Look into dbPickObject/dbPickScreen

Here is an example:



I'm not sure for 3 and I don't understand 4.

Hope that helps a little.

Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 13th Jan 2010 12:34
1 -> 2d, its the drawing of 2d boxs

2 -> thanks for that. its helps me. now i know where to go.

3 -> i might be able to figure that one out.

4 -> um, say on the X Axis you have x1 as you start point and i want to find the second point that is X distance from x1 in the direction of D (direction) and that will give me x2.

example:
x1=12;Dir=0;Dis=12;x2=24
x1=12;Dir=90;Dis=12;x2=12
x1=12;Dir=45;Dis=12;x2=18

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Aldur
16
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 13th Jan 2010 13:23
1. I'm not sure if you can draw transparent boxes, but what about a 4-line function to give a box outline?



4. I've got code around somewhere for that, i'll post it when I find it, its just trig but it's late and I can't think well at the moment.

Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 13th Jan 2010 14:40 Edited at: 13th Jan 2010 14:40
@ transparent box, maybe you can use any sprite,position it and scale it and set it's alpha to 0?

something like that

Aldur
16
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 13th Jan 2010 15:37
Yeah, you could do that!
You could even just use a 1x1 png that is fully transparent for the image

Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 14th Jan 2010 05:54
hmmmm. OK thanks for the idea for one. ill look into that.
well so far only 4 needs solving.
thanks for the help so far.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 14th Jan 2010 12:56
@ question 4

you are looking for the distance between two points?


or you mean, you have X1 as a start, and a direction, and you want
X2? i dont think you can get X2 without something like number of steps or something

Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 14th Jan 2010 23:50
i mean getting the furture x place in a direction of distance of any.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 15th Jan 2010 09:08
dunno the equation for this, but im sure you can:


Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 15th Jan 2010 11:20
hmm. sounds good. ill look into that.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 16th Jan 2010 13:09 Edited at: 17th Jan 2010 00:08
Aludur. you suggestion on my question 2 is good. i had a play around with the code. problem is that its aiming is a bit off.

ScreenShot - attached

from the screen shot it shows my problem.
the given point not were its sposed to be.
i don't make much sense of this.
heres the code that you gave me.


EDIT: Found the screen shot file. see attached.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"

Attachments

Login to view attachments
Aldur
16
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 16th Jan 2010 16:56 Edited at: 16th Jan 2010 16:56
Your screenshot is a blank white bitmap.

But from your code, the reason I believe it's inaccurate is because you are using dbFloor() and possibly because your pick object distance is so small.

I haven't tested your code yet because I'm not on a pc with dgdk, but I will test it later and get back to you!

Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 17th Jan 2010 00:11 Edited at: 18th Jan 2010 06:57
well, dbFloor my own little function for rounding of numbers. even if i do take it away its still the same. i re-uploaded the screen shot

EDIT: dont worry. i fixed it. i tried this before my CSS.SystemAllUpDate(); that handles all the user input such as keyboard and mouse. i then figure i had to call that after.

as for four i re-looked in the documentation and it had what i needed

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Aldur
16
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 18th Jan 2010 08:29
Glad you got it sorted

I was just about to post back.

For your dbFloor, wouldn't it be quicker to just include math.h and use the floor function?

Just an idea.

Good luck with your editor!

Login to post a reply

Server time is: 2024-10-01 23:26:57
Your offset time is: 2024-10-01 23:26:57