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 / - DBPro Coding Challenges -

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Nov 2005 00:10
unless you change the camera size, you dont need to set the aspect to 0.75 as thats the default for a resolution with a 4/3 ratio


Deadly Night Assassins
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 19th Nov 2005 00:18 Edited at: 19th Nov 2005 00:19
Quote: "What does anyone think of mine so far? it's gonna be like that truespace interface."


Oh, come on!?! Have you compared your 13 line code with everyone elses?

I wouldn't ordinarily take the p!$$ out of anyone but you seem to bring it out in me! Why do you insist in posting nonsense in every thread that is open?

[Edit]
That was a retorical ... not an excuse for you to reply! [/Edit]


Great Britain would be Amazing Britain if it wasn't for idiots like you bringing down the average!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Nov 2005 00:51
@RiiDii

Quote: "Head over to the constructor bay (box with yellow stripe to the left if you are facing the star), and enter the tractor beam. The beam will pull your ship in and you will see module in front of you. Use the "<" and ">" (etc - GG)"


Thank you! (Except it was "," and "." on my PC not "<" and ">".)

I must have a go at one of these challenges sometime - although I don't think I'm up to 4200 lines of code as in the last one! (Of course I could write a program to write a *.dba file in which all the non-dynamic "for" loops have been replaced by a series of single commands - but I guess that would be a challenge in itself! I'm told the result would be a faster, if infinitely longer, program! Perhaps the challenge would be to rewrite another program in the most efficient way possible (in terms of execution time) - but that would introduce yet another challenge, namely, how would you measure such a thing?

Sorry, I'm rambling. Thanks again all of you for submitting interesting and stimulating examples.
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 19th Nov 2005 01:14
@Phaelax - Sorry, I'm not sure how the camera can go crazy, here, I limited the sync rate to 200, hopefully that'll help, remember though to for the mouse movement, left mouse button moves in the XZ plain, Right mouse button moves in the updown direction, arrowkeys rotate around and move in/out, shift and control pitch the camera up/down.



As for your mouse look code: First off, pick screen MX, MY, 0.0 won't give you camera coordinates, it'll ALWAYS return (in the get pick vector x/y/z()) 0. The other thing is your calculating the distance realy wierdly, dist# = (py1#*10.0)/(py1#-py2#) change the numerator to dist# = (py1#*10.0)/py2# and you should be fine (I'm also not sure why when you position the object that you position it +50 on the Y axis, might want to get rid of that to unless you have a good reason) Lastly, you shouldn't have to add the camera's position in untill the end. Here, this is what I would change:

So to change your code:



CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 19th Nov 2005 04:50 Edited at: 19th Nov 2005 05:00
Another update from me - apologies if I'm getting on anyone's nerves...

The source is below, but there are a few things to be aware of when you run this version. First of all, it generates some textures and depending on how quick your machine is, it can take a while. PLEASE wait for it to finish.

It only does this once - the next time it is run, it doesn't do it.

Even though not finished, I've also included a short guide explaining some of the options. I'm assuming that most of you won't know half of the things it already does - unless you've studied the source code - which I'm sure you haven't!

Anyway, first the source for V0.1a...

[Edit] Oops! My code seemed to have maxed out the poor old code tags on here and it went bang!

TDK_Man

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 19th Nov 2005 04:56 Edited at: 19th Nov 2005 06:02
Right, let's try again and see if using the code box works...

[Edit] Nope - looks like there's a max number of lines when you upload source. I'll attach it as a zip then!

What V0.1a looks like now:



Quick user guide...

A bit of help for using TDK3D...

Unless you comb through the source code, there are some things you will miss, so I've decided to list the less than obvious things here - otherwise you may think the program is not working properly!

In fact it isn't fully at the time of writing, but you know what I mean...


New Folders

As of version 0.1a, this program when first run, will create folder called Textures and Objects. It will then create a set of textures which can be applied to primitives. Please be patient - this can take a while!!! The next time the program is run, it does not do this.

The program creates .TOG files which are saved in the Objects folder and you can add further textures to the Textures folder.


X, Y, Z Buttons:

Above the Front, Right and Top View windows are small X, Y and Z buttons. These have different uses depending on whether you are in Move, Resize or Rotate object mode. Each can be turned on and off independently.

In Move and Resize modes they represent the SCREEN axis (not the object axis) which operations can be carried out with the mouse. In Rotate Mode they represent the OBJECT axis.

For example, in Move Mode, looking at the TOP VIEW window, if the Y button is down, you can only drag objects Up and Down. In this view, when the object moves up and down, it travels on the Z axis.

Looking at the FRONT VIEW window, the Y button still refers to the Y screen axis, but moves objects along the Y axis.

As you can only have movement along the X and Y SCREEN axis the Z button has no effect in Move or Resize Mode, but is there for use in Rotate Mode where you can rotate along all three axis on all screens.


A Button:

This is the Axis Zero button. Clicking this button will set the currently selected object's default axis to zero for the respective window.

The Front View's default axis is the X axis.
The Right View's default axis is the Y axis.
The Top View's default axis is the Z axis.

For example, in the Front View, clicking the A button will set the currently selected object to X=0, whereas clicking the Top View window's A button will set the currently selected object to Z=0.


O Button:

This is the Object Centre button. Pressing the respective O button will centre the camera view on the currently highlighted object. The other view windows are not affected.


R Button:

This button is the Reset Window View button and resets the view to the initial default.


Selecting Objects:

Click on an object with the left mouse button to select it. Click on an empty area of the screen with the left mouse button to de-select it.


Moving/Resizing/Rotating Objects:

In the Front, Right and Top View windows, this is done with the left mouse button. In the Camera View window, it's slightly different:

Left Mouse Button: Drags, Resizes and Rotates on the X and Z axis
Right Mouse Button: Drags, Resizes and Rotates on the Y axis


Duplicate Object:

When you duplicate an object, the new object will appear in exactly the same position as the old one. In Move mode, simply drag the currently selected object to it's new position and the original one will remain in it's current position.


Selecting A Window:

Using either mouse button on a window makes it the current view window.


Zooming The Current View Window:

The mouse wheel zooms in and out in all the windows.


Window Views:

Dragging with the right mouse button alters the views in all windows.

In the camera view window you can orbit the scene by dragging the mouse with both the left and right buttons held down.


Keyboard Shortcuts:

M - Select Move mode
S - Select ReSize mode
R - Select Rotate mode
C - Colour Current Object
U - Undo last action


FileSelector:

When using the fileselector - used when loading/saving .TOG files, .X files or textures - you need to remember a couple of things:

There are no scroll bars, so use the mouse wheel to scroll the list of files/directories.

When loading an existing file, click on it once and then click on the OK button.

When saving files, click on the box where the filename appears and '>' will appear. Type in the name of the file (extension is not required).

It is important to then press the ENTER key BEFORE clicking on the OK button. The file will then be saved.

TDK_Man

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 19th Nov 2005 05:03 Edited at: 19th Nov 2005 06:03
Sorry for the three posts in a row - the forum didn't like my previous two attempts at posting the source, so here's a link to the zip file of the source:

http://www.computechtenerife.com/modeller.zip

TDK_Man

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 19th Nov 2005 05:26
I think this thread is ready for a news letter mention. This stuff is amazing these last few challenges. TDK - I have to hand it to you. That is some seriously great work there. I might update my code if I have time, but I am really thinking that you are going to take us to the cleaners - so I should just throw in the towel.

Okay - not giving up, but - my way of saying WOW!


Open MMORPG: It's your game!
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 19th Nov 2005 05:49
Yeah, all three of you, especially TDK, are way ahead at this point.

CPU, I'd like to thank you for the tutorials again. They are saving me LOTS of time, mostly because I didn't before know of the existance of the "pick vector" command... (I had spent much time fuming over camera FOV and how it relates to mouse position etc etc -- Just look at my previous code...)

Seeing that all of you are already so far ahead, I think I'm going to take this next weed to solidify my knowledge of vectors (using Philip's excellent tutorials) and hand craft my own mouse position --> 3D position function.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Nov 2005 10:04
CPU, that code gave me some weird numbers. I seem to have it now, fixing that 0. Though the Y value is slightly off. It should technically always be 0 in this particular case, but I'm assuming its some precision error.


Deadly Night Assassins
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 19th Nov 2005 17:03
Ahh.. Sorry, it's rather hard to write code without being able to test it, btw is my function demo working at all for you or is it still going beserk?

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 19th Nov 2005 18:59 Edited at: 19th Nov 2005 19:03
@CPU I was having the same problem as Phaelex with your code. I think I have found what was happening, and have fixed it.



It had to do with the way you used the "pitch camera" command. If you used it, the point camera command didn't work. Plus, it inc/dec the pitch EVERY TIME the loop went on, meaning that if the variable "CamPitch" was not zero, the camera would be doing 360s, which is Phaelax's "beserk."
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 19th Nov 2005 20:49
Odd... you see, point camera 0,0,0 should have reset the rotation of the camera before pitch camera up was used, I'll admit that if you took the point camera command out it would do what you decribed, but?? Not sure why it would do that, It worked fine for me, are you all using 5.9b3?

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Nov 2005 21:51
Even that code doesn't work. The camera stopped spinning, but the cube still doesn't move on the Y-axis with right mouse click at all. And at one point, the cube disappeared when I clicked on it.
using 5.8


Deadly Night Assassins
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 19th Nov 2005 22:05
@CPU I'm using 5.8 still. That might be the problem

@Phaelax Hmmm... I don't know what the problem is on that one, the version I posted works fine in every way for me. (I didn't do anything to the 2 "mouseclick" functions though, in fact, I deliberately avoided them so I could try to figure out the mouseclick thing on my own.)
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 19th Nov 2005 23:06
@Phaelax - That is realy wierd, I have absolutly no idea what could be causing it, hmm... could you run the code, and if it's still giving you those wierd errors copy the code from your editor and post it here, I don't know what else to do, other than make sure some filter program or something isn't deleteing stuff in the code or something, it has happened to me before...

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 19th Nov 2005 23:48
Well, I have been busy for the last while figuring out the "mouseclick" function, and I managed to get it to work. Then, for curiosity sake, I looked at CPU's function to figure out what was different. Turns out I used a shortcut illustrated in my function here:



Then, I checked to see which one was faster(after stripping down the functions so they are exactly alike):



Turns out, CPU's method is about 1.25 times faster than mine (so it looks like I should still use his formula). Still, mine is a bit easiar to understand if anyone is having trouble.

Now, onto movement on the Y axis!
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 20th Nov 2005 02:43
Sorry for the double post, but I got through something else that seemed worthy of a post!

Hmmm, I got through about half of your second Tutorial CPU, and then I thought... Hmmm... This is much more confusing then your last one... Why can't the same ideas be used???

So I tried to do "Y axis movement" using the same ideas as in the X/Z axis movement.... and I think it worked. Here is my updated entry:




Directions: LMB to place a cube in the X/Z plain. RMB to place one in the X/Y plain.

What I did: I pretty much just modified the first version of my function, so that any plain (X,Y or Z) could be held constant.
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 20th Nov 2005 03:52
True, your y function works, however I'm thinking that once you start getting into arbitrary positions in 3D space that its going to be a pain to figure out where the object is going to be positioned. The hardest part about the Y value (and why it's so complicated) is because your trying to find the hight at which two skew lines come the CLOSEST, not touching, and that's the hard part. If you do get it to work, I'll be realy impressed, so keep it up, your doing great!

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Nov 2005 06:56
How's everyone's castles coming along?



And a question...

I'm not an experienced modeller, so I wasn't sure about the term 'snap' other than making the current object 'jump' a certain number of pixels instead of one pixel at a time when you move it. Is this correct?

TDK_Man

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 20th Nov 2005 15:19
Lookin' good TDK, I believe snap is the right way of saying it..

as for my entry, it isnt that good, yet, but its coming along ok.

You can't do much, you can create a bunch of objects, and move them, and scale them. The scaling isn't that good for some reason, and I don't know wjhy, and the rotation is challenging, so I'm gonna work on that just now. Here's my code:




Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Nov 2005 15:28 Edited at: 20th Nov 2005 15:47
Here's your code from my editor. I added a "#" to the Y function name, cause I think it was trying to return an integer. I get a number for Y now on the screen, but the object still doesn't appear to change position at all. Which makes no sense since the value its displaying on the screen comes from position object y()




What's the deadline on this challenge?


Deadly Night Assassins
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 21st Nov 2005 00:04
I think it's in a week

Anyway, updated with rightclick menu (thank millenium7)

the rightclick menu is kinda weird, you hold rmb, and hover over an option, after some time it will be selected, then you can let go..

Scaling still sucks. Rotation doesn't work, but now you can view things as wireframes and solid.

Hold the control key to adjust the camera, use the mouse to move around.

Oh, and now you can also delete objects. Just use the backspace or delete button, whichever you prefer.



Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Nov 2005 18:08
For scaling your object, the mousemove should represent the scaling percentage. Once you start scaling, initially it should be 100%. Then increment or decrement that value based on mousemove. Divide it by 100 then multiple the objects current size values by it.


Still working on the interface. Size, position, color, and default name of the selected object is now shown. I'm thinking of doing groups. You can resize the 4 views. left and front view don't like the mouse code, so im looking into it.




Deadly Night Assassins
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 21st Nov 2005 21:01
@TDK - its not so much making an object jump a certain number of pixels as it is making an object jump a certain number of units, so if I say had the snap set to every 1 unit and I had my object positioned at 1.8, 10.27, 4.99999 the snap function would take those coordinates and round them to the nearest 1 unit, so then my object would then be positioned at 2.0, 10.0, 5.0 simmilarily if my snap was set to say, every 2 units, then my object would be positioned at 2.0, 10.0, 4.0 (remember, 4.9 would round down, because it has to snap to either 6.0 or 4.0), starting to see what I'm getting at?

@Phaelax - I'm totaly lost, it still works fine for me, so the only thing that I can possibly think might be the problem is that you havn't upgraded to the latest patch (5.9b3 is the last patch before 6.0, I don't think the putting out a 'final' 5.9 patch, I'm pretty sure they just declared 5.9b3 the offical patch)

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 21st Nov 2005 23:43
CPU:

OK, that's more or less what I thought it was. I will implement that next!

My biggest problem atm is Delete object. It's just not playing ball...

Better news is that I've re-written the Save/Load routines and my castle object, instead of loading in 40 seconds or so, now loads in 2 seconds!

The new file format also now saves editor settings so when you load a file it has exactly the same camera setup as when you save it.

Duplicate Object has been finished and all the problems with the Fileselector sorted.

You can now Hide/Show objects and there's a snapshot mode which creates a snapshot of the current camera window to disk.

Wireframe mode now has both 'white' and 'coloured' mode.

You can also now click on the Position X/Y/Z, Angle X/Y/Z and Size W/H/D boxes and enter values in directly.

Finally, when dragging, resizing and rotating objects, if you hold down the Shift key, movement is only 1/10th of normal for more accurate positioning.

TDK_Man

The ARRAYinator
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 22nd Nov 2005 01:45
when does the comp. end would I still have a chance to start?
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 22nd Nov 2005 05:20
In a week, so plenty of time (look at what has been done in a single week).


Open MMORPG: It's your game!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Nov 2005 07:59
single week? i just started saturday! It was like an hour after the challenge was posted when TDK shot a picture up already.


Deadly Night Assassins
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd Nov 2005 15:16 Edited at: 22nd Nov 2005 18:59
Quote: " single week? i just started saturday! It was like an hour after the challenge was posted when TDK shot a picture up already."


How do you make that out?

The challenge was posted 14th Nov 2005 at 01:19. I posted my early code for the first time 16th Nov 2005 at 00:27 (2 days later) and posted the first screen shot 17th Nov 2005 at 20:13 (3 days later).

This is hardly 'an hour' after the challenge was posted.

It sounds like you are suggesting that I'm cheating in some way!

TDK_Man

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 22nd Nov 2005 16:32
Hey hey now. I was just posting some generalized "words of encouragement." I meant, it's one week so far (at this point) and look at all that's been done. And using old code, or even using someone else's code (with proper credit), has been considered acceptable because this is a learning challenge as well as a competition.


Open MMORPG: It's your game!
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 22nd Nov 2005 16:41
Ooh - I detect signs that people are getting a bit competetive .... excellent! I think this challenge has sparked off the competetive streak in all of us! CPU is going to have a serious job to do in testing and judging all the entries!

Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 22nd Nov 2005 18:23
well, i was going to enter, but i saw TDK's, and i paled at the thought of going against it

"We make the worst games in the universe..."
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Nov 2005 22:28
I didn't mean it literally. Just saying you got quite a bit accomplished before any of us.


Deadly Night Assassins
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Nov 2005 00:20
That's OK then!

I can assure everyone that my entry was started from scratch a few minutes after reading the challenge.

TDK_Man

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 23rd Nov 2005 03:00 Edited at: 23rd Nov 2005 13:02
Here's an update on my modeller:





I seemed to spend a lot of time ironing out bugs etc - I think it works quite smoothly now though. All of the buttons work except for load and save.


The controls should be pretty intuitive:

- Use the mouse with either the left button (x-z plane) or right button (y-plane) to drag, scale, or rotate the objects around.

-Press both mouse buttons together plus the arrow keys to move the camera around.

Also, you need to create a light source before you can create shadows (duh!) - and so far you can only have one light source. You can move the light source around, though, and recalculate the shadows as many times as you like. It should be quite fast with only a few objects, but with loads of objects, calculating the shadows may take a while.

Here's a little scene I created to demonstrate:



Attachments

Login to view attachments
Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 23rd Nov 2005 03:58
Wow. Ric just added YET ANOTHER excellent update to the list... Man, I'm really behind...

As an update on my project, well... I think I'm going to have to bow out of this for the rest of the time. Before anyone starts to try to persuade me to stay in, I will actually state my reasons:
1: I really don't have enough time to even come close to matching existing entries. (All I can say is... Wow!)
2: The time I DO have would be better spent updating my code library and learning some more about Vectors.

Just as a concluding entry, I will post my final code for this project here. By the way, it does use an (I think working) version of my function which uses the same principle for "Y" as it does for "X/Z" (see for yourselves!)

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Nov 2005 07:48
maybe the next challenge you can compete then.
Ric definately has the better renderer with those shadows.


Deadly Night Assassins
The ARRAYinator
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 23rd Nov 2005 21:49
Could I possibly use dlls like dkshop and dkavm.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Nov 2005 00:59
thats been in the rules since day 1, no DLL's. Shouldn't need DKshop anyway, since vert manipulation commands exist now.


Deadly Night Assassins
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 24th Nov 2005 02:58 Edited at: 24th Nov 2005 10:46
Another update:



I've added a basic texture selection feature - you can either select the texture before creating your object, or you can apply new textures to existing objects by selecting 'apply texture' then pointing and clicking.

But the real bonus, (as far as I'm concerned anyway!), is that you can now have two lights in the lightmap calculation. And, where shadows overlap, it produces the correct umbra and penumbra.



Attachments

Login to view attachments
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 24th Nov 2005 03:05
Wow! That's some of the best shadowing I've seen on DBPro!


Open MMORPG: It's your game!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Nov 2005 06:35
only thing i have against yours Ric is the mouse control. When moving the camera (holding the 2 buttons), object selection isn't turned off. So when I move the camera, I hit objects often and throw them around.


Deadly Night Assassins
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 24th Nov 2005 10:48
Good point - I've updated the code above so that shpuldn't happen anymore.

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 25th Nov 2005 02:46
Update:

just added load and save functionality. It saves the whole scene as a .scn file, and saves the shadow map as a bmp.



The ARRAYinator
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 26th Nov 2005 01:04
what is the date and time this compitition ends?
The ARRAYinator
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 26th Nov 2005 01:52
here is a screenshot of mine.

Attachments

Login to view attachments
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 26th Nov 2005 13:13
Looking good. The deadline is tomorrow (Sunday) at noon, GMT (server time).

The ARRAYinator
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 26th Nov 2005 15:43
Thanks rick for some reason my picture got cut off on the edges.But if you wanted to see it in full it is attached here.[img]

Attachments

Login to view attachments
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 26th Nov 2005 17:20
@ric - verry good, I like the pixel shaders with two lights, however, I think that you could expand it to make it so you could have unlimited lights (or at least as much as direct x can handel) by taking your pixel arrays and combining them into a three dimentional array, (ex: pixelShaders(xnumoflights,128,128) ) then edit your loop so that inside the loop where you cycle through each pixel loop through the number of lights and figure out how much light each pixel gets for that particular light. When that is done add all the pixels from the different lights and average the pixel, then scale that value into a number between 0-255 and draw a grayscale pixel of that intensity. The only other thing you might add in would be (colord lights - but that might be a bit for you to do with the amount of time left) to add an intensity, so that instead of just being a 1 or a zero to say if the pixel is a shadow to provide a falloff for the light so that the brightness starts decaying the further the pixel is from the light... Anyways a few things for you to think about as the final judging is comming up

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]

Login to post a reply

Server time is: 2024-11-23 23:30:53
Your offset time is: 2024-11-23 23:30:53