-
Well if you weren't a commonear (64... hehehe) to the cre8or site, then you probably don't know already, and if you were common to the cre8or site, you probably still don't even know (cause no one seem to go onto that site), so I shall tell you now, cre8or is dead.
Quite frankly I'm surprised that cre8or was able to stay alive for the several years it had, specially since its own creator (kappa/kappax) only was online basically 4 times within t three years. I wouldn't have blame kappax for its death if he actually legitimately explained why he couldn't work on it, or if had of let other people to carry on the project, but no he didn't.
So its dead, now what? or even "what will ever happen to the bird splash screen that always had some sort of invert blend effect on it? WHAT WILL HAPPEN TO IT!?!?!", you may ask. Well now I should have filtered out the people who actually used cre8or between the people don't care what so ever with my long arse rant of the day here, so let me tell you...
I'm currently working on a new version of cre8or, and with my zombie instincts kicking in, I call the project code name, project undead, fitting don't you think?
Some things are going to change with my version of it...
1
I have no site, 1-two I have no money for a site, 1-three I am piss poor site wise. So ignore the site right now, I will see what I can do about that later
2
I am using opengl directly, so no ogre3d nor directx (opengl is better anyways)
3
I'm still making it work with anim8or for multiple reasons, one its awesome, two its easy to use, three its awesome, did I mention its awesome (I love its modeling tools)
4
audiere is the only sound library I got working so its being used (but I got it to work a lot better)
5
The interface is going to be different, but very similar, plus I'm making it more professional (tool descriptions are actually going to work with actual definitions included)
6
the first version of the project undead will look worse than cre8or, but that's because I still haven't got glsl shaders to work yet.
I know I'm missing lots of stuff but that's all my brain is configuring right now so uhh yea, umm if you have any comments, questions, rants, flame wars, curses, just let me know.
-
I was kinda constant until I couldn't run it on win7. But you're rewritten the entire thing, or did he provide source code? You could use a site like webs.com or other to make a site, also. Hopefully, people will donate to the project; I'll definitely use it once it's released, so as long as it's as easy as Cre8or was ( in that 'GameMaker' way).
-
Well kappa never released source code for it, but it was ripped from machine code into .net code, but that kinda really sucks (multiple ways from a programmers perspective). So I am programming the whole thing ground up, and doing it the way cre8or was originally made, where it uses an engine to run scripts, and I'm going to make sure that all the issues and bugs that were never fixed in cre8or, will be fixed, or better worded, not even in existence (AND I WILL MAKE SURE OF THIS!!!!).
And I'm going to make as easy as cre8or was (probably even easier without the bugs).
It would be sweet to write my own compiler, but that would take am excessive amount of work (college graduates wouldn't even bother attempting at that).
ALSO: Ive already tried all the libraries I use on my moms computer (windows 7) and it works.
So for sure windows 7 and XP will be able to run it, all the libraries I use also support UNIX systems (linux, and possibly macs, but I really don't care for macs so they can suck it :P )
as for the site, it would be awesome if people donated to the project, although I highly doubt anyone would, and I also want to stay away from those free sites. I need full control over the site access, be able to use php, as well as html (of course) without advertisements (from those free site hosters), that and I hate when you got something like www.freewebsites/blahbhskdha/23478/adk/hi/what_the_Heck_is_this/THE_WEBSITE_NAME.com
if you get my point.
-
cooldude, I LOVE YOU! ;D no, just kidding... but its awesome what you are doing ^^
-
I can offer you hosting on the-meadow.net, maybe as a subdomain with ftp and mysql access.
-
That would be nice, as for now, I don't know what I'm doing for the site.
Me and a friend were going to set up a server over his network if ever were to get it upgraded, he has unlimited bandwidth but very poor speeds (and his parents play a lot of WOW), while I have loads of speed (32 Mb of download speed), but with the disadvantage of having only 150 Gigs of bandwidth and almost going over each month (just under by about 10 gigs), basically if I do not do file uploads (uploading images and files) then I should be good for hosting a server from my end.
-
Alright so how the new website shall be done...
I'm setting up a server and hosting from my end, BUT there will be no file hosting/downloading/uploading cause that takes ALOT of bandwidth, however, I suggest you just use mediafire and just send a link when you want/need to download/upload etc. etc.
That way, my internet just doesn't die (or at least the bandwidth part of it), cause if I go over my limit, I have to pay an outrageous fee for ever gig that goes over (about 10 bucks per gig)
So with just the site and a forum (using smf, its amazing), the site (estimated with a random number of 50 users daily) should take no more than a gig per month... hopefully
-
i just started to get into cre8or. the one major problem i saw was the lack of material on how to use the program. i know it changed in the later version but that was the only one i got to run on my computer and everything was changed. i had no luck at all finding anything useful on how the program actually works. + i was on there for like 1 or 2 days and the forums went down so i didnt have that much time to work on it.
i do hope u get it working again. it does look pretty cool
-
Well don't worry I'm going to include documentation that is built in and also external.
Which will include function/tool descriptions explaining what they do, how to use them etc.
And there will be a tutorial that will introduce you into programing etc, and using project undead.
If I'm going to spend time into working on this, I at least want people to use it.
-
I like how you're only moving towards the complete practical. It seems most people who write programs give them up while there's still not much practicality to them. Have you started programming, or are we looking at a released date any time soon?
-
Well I'm one where if I know I can get it done, and I want it done, then it will get done.
If there is a will, then there is a way, and if there is a way, THEN IT WILL GET DONE!!!
:P
For a release date, I wouldn't be able to tell you when a official release of a version i.e. version 0.1
But I will have unfinished releases to give people something to look at progress wise (other words, version 0.0.1 :P )
Currently I'm spiffing up methods on how things work.
Because I'm doing things the same way cre8or did originally (have an engine that runs the code you made), rather than an actual compiler I have to manage things like, how variables should be declared, how to manage class and structures etc. etc.
That and I'm also trying to figure out how to get opengl into a windows forum, which will defiantly come a lot later since its not the easiest thing to implement.
Currently I haven't got any of the windows stuff in (buttons, labels, drop down menus, you know the WINDOWS windows stuff), but what I do have done is bits of the engine that will run the code made in the mew cre8or program.
Does that make sense? I think it does, well I'm trying to make it easy to understand for everyone, rather than just a programers point of view.
-
Hm, I don't know anything about that programming stuff, but...what about cre8or itself ? I mean, was it open source, freeware or what ? May be you could just continue cre8or ? It had reached a very good level already, so all your energy you could "put" into its farther development ! Or you just want to cre8 a program entirely your ?
-
Weeeeell...
Cre8or was never open source, neither was the kjx engine (the engine used for cre8or), and since kappax didn't work on it at all, or even let someone else take it over, it became severely out dated.
So with all that being that, I just decided to bring it back with my own two hands and mind.
So does any one see anything that needs to be added to the list of stuff, I don't know if I am forgetting anything?
Currently Working on: Shaders for opengl (glsl)
-
A nice small update, I got glsl shaders to work. So now I just got to do some fancy tests and figure out how to implement them into the project undead.
For those who don't know what glsl is...
These people are using it youtube.com/watch?v=Gj4vvlWuL8E[/youtube]]http://www. (http://www.[youtube)
For those who don't even know what a shader is...
Here is wiki for ya http://en.wikipedia.org/wiki/Shader (http://en.wikipedia.org/wiki/Shader)
So with the addition of shaders, so much stuff can be added in to make things look nice and pretty.
-
Emm, as I said before I know nothing about this stuff, but, have you the core finished already so you're going for details now ???
-
Great idea! I've tried the cre8or a while ago, but because the lots of bugs I gave it up. Also Polly looks like it's gone to never come out.
-
Hmm, what bugs exactly ?
And cooldude234, will it have the ability to render scenes from anim8or with physics, like in cre8or, or it will be just for making games ?
-
Oh yes, I really like that function, so I will try my best to make it support that. Which if I do get working I will add a few more stuff to it, maybe a function to set the capture rate, originally it just captured every frame, this could make it run faster.
And by bugs, yea there was a little too many. I actually have about 100 different cre8or projects, but because of the issues from cre8or, most of them became corrupted files, even from doing something as clicking a button could make this happen (which from a programers point of view, I really don't know how that would have been possible unless if you deliberately did that, or you were just too lazy or stupid). Only about 5 or so of my projects were actually posted on the forum because of that.
Currently I'm having issues running shaders on ATI cards (which GREATLY SUCK ARSE!!!). And unfortunately I can't really do anything about it. Its ATIs drivers, it won't support opengl 2.0 (needed for glsl shaders) on older cards from which Nvida's equivalent would be able to quite easily. So my laptop wont be able to things like lighting ect.
DUMB ATI!!!!
Also another issue I'm having is running my engine on other computers particularly using 7 64 bit.
Haven't tried vista yet, but the vista computer in my house is still 64 bit, so I cant really tell if its because its 64 bit if it doesn't work, or if its because of vista/7.
So what I'm going to do is make all my functions, classes, structures and methods for my engine, and try and worry about compatibility later.
-
I'm running 7-64bit at home. Let me know if you want me to test something out for you.
-
Thanks, I will have public alphas and betas for testing, when I get that far I will have it uploaded and people can download and test it on their machine.
First I have to get the rest of it done though.
-
Well I kind of ran into some neat things, and some bad things...
One shading doesnt seem to work on ANY ati cards properly, and all non gaming machines, pretty much any machine that doesn't have a nvidia card with 1 gig or more of ram and made as of 2008 pretty much doesnt support anything higher than opengl 1.5 (which opengl 2.0 is needed for glsl)
So this may be more of a question to steve, meaning it probably will never be answered, but with the slight glimmering hope in me, I just, just hope it can be and will be answered.
Does anim8or use a fixed function pipeline for its shading, or does it actually use modern shaders?
For the for the renders built for anim8or (scanline and raytracer), do they use a predesigned shader program or are they using a customly written one?
Any other thoughts on how to get shading on machines using opengl between 1.1 and 1.5?
-
P.S. OOH DO I EVER HATE ATI SO MUCH!!!
-
Scanline and raytracer renderers are software only.Videocard
not used at all.
The Opengl renderer requires 2.0.So,it probably uses
GLSL.
In the viewport,to see all the implemented features,you need
Opengl version 1.4.Shaders are used. 1.4 is the first version supporting
shaders.It's an assembly type of language,but you can use the Cg compiler
to output a source.
Don't loose too much time on this,it's really outdated.
Get an Opengl 2.0 card.If you can afford it,3.0 or 4.0 would
be even better.
Hope this helps.
Bye
Claude
-
Well its not so much for my computer, my main computer handles opengl 4.0. Its more so about the people who don't have the computers that can use it.
My moms machine is only 2 years old and it can only run 1.5. Might be able to get to work on her machine using the arb functions, but not on older machines using ati.
I think I might now a method that can work without shaders at all. In theory it should but I haven't tried it out yet, nor do I know how fast it could run. If this theory of mine does work though, you could have the equivalent of shaders using opengl 1.1 on machines from year 2000.
right now about 30 minutes ago actually, I just got camera functions in for first person, third person and what ever view you need. Next, I might try and do some real time raytracing (I've only programed that in 2d before!)
P.S I know scanline and raytracer are software renderers, I just wanted to know how they were implemented. I thinking it might be possible to use it in the opengl pipe line system...
and I still really hate ati
-
really miss cre8or, I had entire worlds built and now they are lost :'( cant wait for an alpha or beta test !!!!
props for taking on this desperately needed project!
-
Well great news, part 1 of my theory works.
The new cre8or shall have....
BLUR effects!!!
and it also works on my laptop using opengl 1.1 so everything is good on that!
Now, on to part 2 of my theory.
-
By blur, would that include focal techniques? If so, that's SWEET! This project is pushing thourgh like a boat in water! Can't wait for the release!!!!
-
So I was messing around with this technique and so far I have acquired, a global motion blur, a global Gaussian blur, a global zoom blur and a few other things that are not able to be described (some sort of distortion effects that I got from messing around with numbers).
Also, what I mean by global is that it effects the whole entire screen, but I'm hoping there is some blend effect that will allow me to use a depth map/ height map to pass transparency. That way you could easily generate a texture that has the closer objects whiter and the farther ones darker, so that the white space is blurred and the dark space isn't.
Anyways, I'm hoping to have some screenyshots posted soon. Just as a reminder, this is just the overall engine I'm working on right now, so there's still lots more to go, but other than that, I would have to agree, I'm getting allot further than I expected.
-
Just tested out some joystick/controller compatibility stuff, and well...
I GOT CONTROLLERS TO WORK!!!!!!
Unfortunately you can only have up to 16 controllers at once (per machine( <-not foreshadowing there at all))
So, try not to have a party of 17 people, we don't want people feeling down cause of a limit of controllers.
;)
-
Well I promised some screenshots, and I really don't want to break that promise, so here ya go!
-
Made some tilt shift blurring, well a fake method of it anyway.
-
Hey dude, it's becoming really (
useful) cool, good job!
#PS: Loved that blur-like effect.
#PS2: cre8oristhe here ;D
-
Hey, I haven't seen you around in a long time, and thanks!
-
Well I just acquired a netbook with windows 7 32 bit on it from my friend. It will be in my possession for a week or two for some window 7 testing.
So far I got some quads (3d squares) to be rendered but no textures are present, and the order of the depth buffer (may be cause by the glblendfunc I am using) seems to be really out of wack. So I hope to get everything working fine on window 7 machines.
-
Great News, I got this to run on a windows 7 64 bit machine,
though it was a friend of mines computer that has a decent end graphics card (defiantly not an ati :P )
So everything was up to date on it, though this still means it can run on windows 7, and 64 bit on top of that.
So now to try and get it working on that netbook...
-
Runs good on Linux, except for the depth buffer not working properly and one small texture scaling issue.
-
So pt 1 of my conclusion is that this application, will run on any OS (still haven't tried macs, though I do not care so much for them, mainly just Windows and Linux ;)), but it has many troubles considering ATI graphics cards, and Intel graphics chips.
So at the moment, anyone using Windows or Linux with high(er) end graphics cards, will be able to run it perfectly fine.
So my current goal is to try and get textures working on Intel graphic's machines.
-
I remember using Cre8or. The only thing I've only managed to make on it was being able to flip a cube or sphere around on a base.
-
I got Opengl's Built in lights to work and everything's fully functional.
Things you can do with them are quoted here...
-Create Point Lights
-Create Spot Lights
-Define size of spot lights
-Define the softness of Point + Spot Lights
-Define the colour of Lights (ambient, specular, + diffuse)
-Define the intensity of Lights
-Angle Spot Lights
-Move Lights
-Plus, all of the above can be changed anytime during execution of code
(meaning you can change any states of it while your game is running it)
*starts singing victory song from final fantasy 7*
Dud du duda, da da dada, da du dada duuuuuuu...
[move] [move]8) 8) 8)
[/move][/move]
Anyways, it's time for those famous screenshots time!!!
-
And another one...
-
Well I learned some more about C++ vector classes, and was able to work on some more of my model loader.
So now, I can officially load up wavefront .obj files.
There's still quite a bit that needs to finished, since it only allows quad faces (square faces), and doesn't support texture coordinates yet (which I've temporary replaced with setting the faces a random colour each) and is glitchy on its normals (but even for that, the lighting seems to react fine with it).
once I get everything working 100% in the .obj format, I make it so that it will load up anim8or files.
-
SPACESHIP!
-
Well I now have pixel perfect mouse input working using a opengl function call gluUnProject, which basically reverses the matrix (the algorithm for making everything 3D), and is able to translate the mouse's position on the screen, into a 3d position.
Now I did this twice once, close to the screen, once far from the screen, so I have two points. In order to get full ray casting to work with the mouse I need to get the angle in degrees.
So I'm in a bit of a need for help. Does anyone know how to get the angle of two points that are relevant to the world?
Meaning I have two points, and if you were to draw a line horizontally towards from one point to the other, and vertically for the other, the point of intersection would be the third point. Forming a right triangle. Here's a picture to help visualize what I mean.
-
If you know the distance between the points and the intersecting point,
sin=opp/hyp
cos=adj/hyp
tan=opp/adj
So Angle of Point #1= arctan(distance between point#2 and intersecting point / distance between point#1 and intersecting point)
-
I tried that before, but it keeps yielding weird results. It must be something that I am doing...
Hmmmm, I'll have to take another look at it.
-
Should I mention that these points are in 3d space.
I was just just calculating 2 triangles one for the x and z (yaw), and one for the x and y (pitch).
Would that cause some issue with this equation?
-
It seems like it'd work but I don't have much experience with 3D/vector math and such, at least not yet.
I'd assume that there are several libraries out there with functions that automatically calculate these kinds of things, and websites with info on this kind of math.
-
Yea, I don't have much experience with 3d vectors.
I've done what I'm trying to do now with 2d along time ago and got it to work flawlessly.
I only recently started programming with 3D only at the start of summer. So I'm assuming that it must be something either that I'm doing, or something to do with the fact that it is 3D, or both.
-
Well I solved one issue, still getting weird results, but however it seems that when I used the atan funtion (arctan), with the distances between two points etc etc. It was actually returning the value in radians, so I multiplied by 180 and divided by pi to convert it into degrees and now I'm getting the correct angle that the mouse is pointing.
Though my issue now I believe is just a matter of my programming, cause the ray is being projected correctly on the angles Yaw 0.
-
I've studied 3d calc and 3d physics a few years back, so I can probably dig up an answer for you, but I think I will need to know more details about what you are trying to do and what numbers you want to end up with. The problem could be a few things. Are you using lines or vectors? Is distance important or just relative orientation? The world, the camera, and the objects all have their own coordinate system, so which angle is being compared to which? E.G. "line between camera and its focal point in relation to the world's z-axis." And of course, a Google search for "angle between two 3d lines/vectors" will tell you more than I ever could on the subject.
-
3d calculus, I probably could never sit through a course of that :P (even though I probably really need it)
Well for starters, I'm using OpenGL so everything is computed through matrices. The world has one matrix, and the objects have a matrix so there are matrices in matrices.
Though what I'm doing is just getting the angles of things and letting OpenGL display it in a matrix (I say where to put it, OpenGL puts it there). I'm using a function (gluUnProject) that gets the 2D coordinates of the mouses position and reverses the main matrix to get its position as a 3D vector. I can define on how far back I want to "unproject" the mouses position (I can define a mouses depth). So I unproject the mouse twice, once close to the camera, once far from the camera (NOTE: OpenGL computes the angles of the screen, so when I say depth I do not mean the worlds z coordinates, I mean its the depth relevant to the area that the screen is viewing). Then I get the angle from those two points (as I have solved with Raxx's help above).
Now what I'm doing with this angle is...
I have a for loop (a type of loop in computer programming for those who do not know), that goes through for a number of times (which is the "life" of the ray), and moves a certain distance (which I can define as any amount I want, for now its just moving a distance of one tenth (0.1)).
So I'm trying to figure out how to use sine and cosine to compute the yaw and pitch of the ray and the distance to move by and put in a 3D vector coordinate (so compute yaw and pitch, to get the amount of x y and z to move by).
There are multiple ways to make rays, I want to implement at least these two ways...
The way I have above
and an intersecting point, which contains two points, and finds the intersection of objects and whatever in the line formed by those two points.
The reasons why I want the one above, is because then you could cast the ray to infinite space (for as long as the application is running you could have the ray moving). The reason why I want the other way, is to have accurate and quick results.
Also I'm planing to combine the two ways, cast a ray that moves a distance then checks if there was an intersection between that position of the ray and the last. So I could have the infinite ray and accurate results together. Basically I'm making it so that you could use rays to the max.
-
Oh, AND OF COURSE I'VE CHECKED GOOGLE...
That was the first thing I did.
-
OHHHHHHHHHHHHHHHH YEAAAAAAAAAAAAAAAAAA!!!
Says the koolaid man :P
Great news!
I have just got mipmapping to work! As well as I am using gltexture2d now, which is more compatible, and yet on top of that! I still have non power of two textures working!!!! BAM! Imma in a goood mood now (:
I mean, it only took 7 months to find out the solution
So for those less techy out there, mipmapping (in 3d graphics) is the process of making copies of the texture, but each copy is a downsized-smoothed version of the texture usually dividing it by two each time (first texture actual size, second half, the third half the the second and so forth), and using the texture(s) according to the distance from the view point so that the further the texture is, the more downsized it is. This makes the system run much much faster as well as making the scene look much better as it gets rid of great pixelizing distortion. In fact anim8or uses the mipmapping process, you can see it in the textures when you zoom out far enough, or got on a certain angle from the face.
EDIT: and happy 10 hours late new years :P
-
I just tried it out on the intel graphics (netbook), and it works 100%
This pretty much mean that any lower end pc's are now compatible (which is well over probably 50% of the users estimating)
-
Back to the ray casting issue, still haven't solved it, though a better name to give what I'm trying to do, is convert a 3D a yaw and pitch into a normal vector (or a directional vector). Just in case that helps to spread some light on this problem.
-
Sorry I never got back to you on that, but my idea of a vacation is to lock myself away in a workshop for 2 weeks doing metalwork.
Quick stolen answer:
"If we define pitch=0 as horizontal (z=0) and yaw as counter-clockwise from the x axis, then the direction vector will be
x = cos(yaw)*cos(pitch)
y = sin(yaw)*cos(pitch)
z = sin(pitch)"
And I'll add to that that in 3d math the length of your vector will be L^2=x^2+y^2+z^2 - the 2d equivalent is a^2=b^2+c^2 for right-angle triangles. So you can use that to convert your vector to a normal vector of length 1 and then multiply for the speed of your object.
If you want to add gravity or wind, etc. then it is a simple matter of adding an acceleration vector to your velocity vector in gradual increments (for example, if you wanted to add a simple gravity vector you would add a vector of 0(x) -9.8m(y) 0(z) every second - breaking it into fractions, of course).
Just keep in mind to keep the speed of your object separate from the frequency of your game loops. Which is to say that if I am playing 60fps and my friend is playing at 30fps the I shouldn't see rockets flying twice as fast as my friend does - relativistic physics notwithstanding.
I hope this helps :)
PS Quick correction: I've verified that the stolen formula, above, gives you a vector of length 1 so you won't need correct the length to get a normal vector
-
Cool, what kind of metal work do you do?
radx = ((Yaw)+90)*3.14/180;
rady = ((Pitch)+90)*3.14/180;
rady2 = ((Pitch) / 180 * 3.141592654f);
Note that this is just converting to radians... or degrees, I cant remember
rayx -= sin (radx)*(sin(rady)*2.5);
rayz += cos (radx)*(sin(rady)*2.5);
rayy -= sin(rady2)*2.5;
And this is the closest (by closest, I mean the best result I could come up with that still does not work) I got to getting the ray to work, but when the yaw gets closer to being 0 the pitch of the ray is multiplied more and more.
Thus meaning if you are slightly looking up and the more you look to the 0 of the yaw, then more the ray looks up
(NOTE: it is multiplying the pitch and not adding, cause it is not noticeable until you are near the 0 of the yaw)
I tried the one you gave, it still doesn't work.
About the gravity and wind, I already know all that, although I do not store my velocity variables in a vector, though I should under the objects name, box.xvel etc etc. and I probably will do that, but not right now. And gravity is the most simplest (unless if you want to planetary gravity were its just not pulling you "down", which I have also done, just in 2d)
And for you last thingy, I know what you mean, first off you have to limit the fps (frame rates per second, not first person shooter) and also you could make a dynamic fps limiter which depending on your fps count, depends on how fast the world objects move (really tedious to implement but cool once again, also have done it in the past), But usually those factors are usually only done with, when you use networking and the host is usually the machine that doesn't lag.
*phew* that's a lot of writing, I got to learn to summarize
-
Without going into too much trig, I can say that your second formula works out to be the same as the one I quoted - with the obvious exceptions that you've scaled it from a normal vector to a vector of length 2.5 and you are using a different base orientation. That one is just fine and shouldn't be causing you any problems.
In your first set, where you are converting to radians, your rady2 formula is ambiguously parsed. Depending on how your code is being assembled the value could be (pitch/180)*pi or pitch/(180*pi), so I'd recommend a pair of brackets to be sure - with the first one being correct. That difference can affect your vector length, so maybe start there and see if it helps.
ps currently I'm working on a Mongolian helmet, a Lithuanian helmet, and a pair of gauntlets.
-
absolutely nothing changed.
So if your saying the that the second half is correct (which is where I thought the problem was), then I guess there's a lot of work to be done. Cause I have no clue whats going on anymore.
On the bright side, I fixed my billboarding issue. It turns out that y axis while rotating the quad was inverted, so there is now officially billboarding implemented. So I can now continue with making the particle systems structure.
So, what else do you think could be causing this issue music waters (the ray tracing one, I know I just bounced back between two different things :P )?
-
Thanks, even though I couldn't get that silly box man game to work, hopefully I'll get a second try.
-
Yea don't worry, my plan is to include a whole Manuel built into this thing, including example projects, example code and full tutorials.
It's just a matter of getting past this ray casting bull crap :P
EDIT: PS water music, damn now I want a pair of gauntlets
-
To continue this raycasting headache...
It turns out that the pitch of the ray, when it goes closer to the right or left issue, was actually not being casued by the projection of the ray (all of that trigonometry stuff I show), but rather is happening when I try to get the angle of the pitch.
double get_angle(float x1,float y1,float x2, float y2)
{
double angle=0;
if (x1 - x2 != 0)
{
angle = (atan ((y2 - y1)/(x2 - x1)))*180/PI;
}
return(angle);
}
that is my oh so lovely function that is used to get the angles between two points, this is working for the yaw, but it doesn't seem to be working for the pitch *sad face*
This is it in action
rayPitch = get_angle(start_z,start_y,end_z, end_y);
So, I got to figure out how to gather the pitch from two points.
JOY!
-
with no luck on trying to get a pitch between two 3d vectors,
I would like to know on what kind of tools would people like to have link to anim8or.
I know that importing from anim8or is going to be in, and once I get physic I will make it output a physics simulation as well.
I also got the particle class working with billboarding (have it facing relevant to the camera, or just on a particular axis), so I may as well export particles kinda like what terranim8or ( <- what the hell, Firefox says that's spelled correctly but yet billboarding isn't ??? ) did.
So tools for sure that will be link with anim8or...
-Import from anim8or
-Export recording of scene
-Including export of particles
and I might figure out a way to manage scenes in anim8or and the new cre8or so that you could add an object in anim8or, in a previously recorded scene, and go back into the new cre8or and rerecord everything, import it back into anim8or, and it would keep the object that you added in anim8or (in other words it would not override things that it doesn't need to, so you don't have to redo crap)
so any other ideas for tools associated between the new cre8or and anim8or?
-
Hey dude, here's a tip for your scene export thing: use a timestep and finite state machine.
Explanation:
Use fsm (finite state machine) to record current game status, and use timestep to synchonize it to frames.
Also, here some Opengl tips...
-Always use the vector forms of these methods: glvertex,glColor,glTexCoord and glNormal.
-> gl(Vertex|Color|texCoord|Normal)(2|3|4)(f|i|d)v(array_of_values)
-Use display lists for materials and texture units, using glColorMaterial(face,mode) to reduce function call overload:
->glColorMaterialf(GL_FRONT,GL_AMBIENT), now glColor3f() will affect current material ambient. To enable glColorMaterial use: glEnable(GL_COLOR_MATERIAL).
-Use Vertex buffer objects for animated meshs and terrains, or use interpolation between frames (Lerp or qLerp).
-Keep non-gl code before Opengl code, it speeds Opengl rendering.
-use delta-timing for Syncronism (principally for networked games).
->//Loop beginning
time := glutGet(GLUT_ELAPSED_TIME) //or similar like GetTickCount()
delta := time - delay
delay := time
deltasec := delta/1000 //convert to seconds
playerpos.x += player_velocity.x * (0.5 * deltasec) //moves 0.5 units in x, independent of application speed.
Sleep((1000/frames_per_second)-time) //Frame limiting (obs: it don't work in my Engine)
//Opengl Code
...And that's just some tips (and tricks) to speedup your application. I've attached 2 screens of my 3d Engine.
-
I've used display lists and the colour materials (I still haven't worked it out for everything but it is working and implemented) but there is one particular part of your statement that I don't think I will ever use, EVER.
GLUT_ELAPSED_TIME
Nope, no glut here. Besides I already have the equivalent function work out.
but yea, I very much like the display list and such, it can save about 16 milliseconds on my tower for one object, which is a great deal when you are rendering thousands and thousands.
So any other ideas for tools between the new cre8or and anim8r?
-
Sorry, i have no ideas for new tools (Principally for anim8or) :'(.
-
Hey there, cre8orexpert. To cooldude234, I'm thinking my ideas are some REALLY tall orders that definetly will have to wait. but...
Soft Body Physics? For cloth, hair, stuff like that? (Or is that something we do manually?)
Perhaps mesh distortion/fragmentation, for things like explosions where objects can actually fly apart at random, of get realistically dented.
I know for a FACT that these things are REALLY big features, not to mention that by no means are they required. What do you think about them?
-
Sorry, but as you can probably tell I haven't gotten much forum time lately, and also don't have much time now. But getting the degree of pitch from a 3d vector is pretty easy so I had to take a second to chime in.
Quick terminology, you have point1 -> (x1, y1, z1) and point2 -> (x2, y2, z2) with the vector between them being (x2-x1, y2-y1, z2-z1) which I'm going to call (dx, dy, dz). "d" is referring to the greek letter delta which just means ("difference in x", "difference in y", diff z").
The length of a 3d vector is L=sqrt(dx^2 + dy^2 + dz^2). Then you just make a right angle triangle with the vector as the hypotenuse, and dy as the opposite edge from your pitch angle. Then you can use 2d trig.
Pitch = sin^-1(dy/L)
or Pitch = sin^-1(dy/sqrt(dx^2 + dy^2 + dz^2))
And if you want to get the Yaw, you then ignore the Y component of the vector completely and sort it out with standard 2d trig.
I hope this helps. I'll try to check back over the next couple of days to see if you need any clarification.
-
Right So I got it working, but however it only works on one particular side (the left side relevant to the world), and I was just wonder if in the math there is some way to just make it 360 able (the values of the angles only go from -90 to +90), or would I just have to make a complex if statement and reverse the angles?
And clearly this states that I suck at math :P
-
Yes, I think I know what is going on there. I sort of took the calculation of the yaw for granted as it's pretty straightforward on paper, but in computer speak there are a few cases that you need to take care with. So I have a new formula for you to try out to get your yaw angle that should take care of everything. I couldn't get it all into one calculation, but this is the most graceful I could get it:
if dx=0 and dz=0 then
yaw is unchanged from its last orientation
else
yaw=sin^-1(dx/sqrt(dx^2+dz^2))
if dz<0 then
yaw=(pi/2)-yaw
The first part is to take care of situations where the yaw component is non-existent: straight up, straight down, or not moving. This will require your keeping track of the last position, or building up functions for special cases. Movement along the y-axis is problematic, so one way to deal with it is to keep anything from being able to move to an angle which is perfectly perpendicular to the ground -> pitch max of 89 degrees. Otherwise, if pitch exceeds 90 degrees you'll need to invert the yaw 180 degrees and roll the object around its z-axis 180 to get the pitch below 90 again - if you follow. Best to just not let them get there.
The second part is the best way to calculate the angle without running the risk of getting a DIV0! error at the x or z axis.
The last part is what takes you from a 180 degree angle to a 360 degree one - except in radians, of course. I couldn't see a way to integrate it into the other calc, so I think you may have to break it out into an if statement as I have done.
edit: forgot to mention that this will calculate the angle as increasing while rotating clockwise. If you want it to increase counter-clockwise then replace dx with -dx in the formula.
-
Yea I was just trying to see if I can eliminate another use of an if statement, but however presenting that you are using one, I guess I'll just stick to the one I am using (it may not be noticeable difference in speed, if you eliminate one if statement, but over time you can see a difference).
Thanks music waters, you've help me eliminate one problem.
So since I can't embed useful things into my signature, (there's not even enough space to put a simple smile), I'll have to continue telling you what I am currently working on in the form of a post.
First off, getting angles completely working now, I'm able to do a lot more now.
Also I finally decided to incorporate the very not so hard distance formula (I was really lazy to put it in, but its finally in), so now you can use the function getDistance (pointA, pointB) and it will return a number equaling the distance. This incredibly helped a lot to my surprise, as I now have the basis for dynamic cloth and rope simulation. It's a little glitch however because I haven't incorporated centripetal force yet, but AM WORKING ON IT!
Also I can display things that are in a (proper) distance, unlike before it was just checking if things were in range by a square (which looked terrible).
I also got a efficient cube (environment) reflection done, and a few other cheesy looking reflection that look cool if done properly.
I've been also learning more about simulating physics, I might make my own physic functions, or might use just use bullet for the final thing (cause bullet is still awesome), but I still want to learn more about 3d calculus and other things for my own sake of learning.
To davdud101, somehow I over looked your post and didn't see it, well if you read this far you'll know the basis for cloth and rope physics have started to be implemented, as for other soft body physics why not, making a cube jello-y like is actually a lot simpler than cloth physics, in my opinion that is. It's when it comes to physically contacting a surface and moving or rotating in a realistic manner that become the hard part.
Mess distortion, well I was going to have some why to be able to edit the vertices of an object (still have to figure out how I want to make it call a specific vertex), which then you could create a set of variables (an array of them) to store positions or properties of them, so you could store the colour (damnit Firefox, don't tell me you think colour is spelled wrong) of one vertex, oppose to the whole object.
Because of rope physics being in, inverse kinetics are now a possibility, that is once I get bones in.
Also I have been working on the scripting part of the new cre8or some more. Figured out ways to make it run faster, to call different scripts and more. However I still haven't figured out how to make it possible to be able to create new variables on the fly in a script (I could make it stacked based, but that's the ONE MAJOR THING I HATE ABOUT SCRIPTING LANGUAGES!!! I never want to lean towards the stacked based scripting language EVAR!! <- purposely spelled like that :P
Sorry for the long post, I just needed to tell you whats been done the last week-ish or so time that has passed. Also somehow I am failing school because of my English, but yet I corrected the teacher many many times already. Questioning on how that works.
-
You're welcome, just make it awesome for me. You actually can get it all into one formula without an if statement, but it's ugly, unreadable, and probably won't end up saving you any cycles.
Yaw=((dz-|dz|)*pi/4dz)+((-1*((dz-|dz|)/dz))+1)*sin^-1(dx/sqrt(dx^2+dz^2))
edit: oops, scratch that. It'll give a DIV0! error along the x-axis
I think that's right, but I haven't done much error checking. Basically I've included a weird negative/positive if statement into the formula. But I doubt it works any better on a machine level so I'd keep it the way you have it.
My degree was actually in English (by way of physics) but I'm afraid that the only advice I have to offer on that score is to make a habit of asking your teacher for help on a paper/project before submitting it. That will always net you a higher grade just because your teacher would rather give you a higher grade rather than admit that they couldn't offer any actual assistance. Sad but true. The internet is destroying the English language anyway.
-
The internet is destroying the English language anyway.
LOL... oops :P
I think the get angle function, that I have now, may just be the best I will ever get it, I might make it better, but for now its definitely good where it stands.
When I get around to it I'll make a screen shot showing off some of this stuff (lot of it has to do with motion, so I might put it in a animated gif format)
I'm thinking of adding in shaders, though that isn't compatible with older hardware, I would have to add in a on/off switch for it. To be able to enable and disable shaders, would allow older hardware to use the fixed function pipeline (if equivalent to the shader), in that case, shaders would have to be considered a addition, rather than a dependence, if not then the game you made with the engine and the new cre8or would have to be considered incompatible with older hardware.
-
I could make it stacked based
Sorry, I meant to say Heap based, stacked based shrinks and grows, STACK based is a constant sized chunk of memory just for the application.
-
Well I decided to ignore all the crap with trying to make variables work in the scripting part, and decided to stop being lazy and implement fonts already.
So yes I got the basics in for fonts.
FOR NOW, I'm doing what cre8or did, and use texture fonts.
Basically they're just a texture, or an image of the letters and ascii thingies.
Then I take that texture and I take the string (the line of text), and I print out the right letter on the texture, for the right letter in the string of text. I'm printing out each of the letters as an individual sprite on a quad (a square), so that they can be printed to the screen or in the 3d world.
I'm going to make some functions and properties for the text such as colour and things.
I also might make them changeable in the string itself
eg.
this is {color=pink} Red {/color} etc. etc.
I'll make the syntax shorter than that though (also I borrowed it streight from this for, as the [ was just swaped with { :P )
I also want a length property in, so you can make the text continue onto another line once it reaches a maximum length (good for making paragraphs and text boxes)
SCREENSHOTS
-
Made the basis for lines and what not (didn't check for words, so they just get cut off).
Though I find when I print lots of text, it slows down greatly, so I have to optimize the functions a bit, and I might make each letter as a display list to also make it run faster.
EDIT: made each letter as a display list, runs much much much faster now,
I also added in the size property, so you can change the size of your text.
Next I might work on colours, then some other properties, like toggling bill-boarding.
-
Eeek, 5th post in a row
Well just to show something cool
Bluring the scene, with text over top, with text having depth enabled :)
-
Eeek, 5th post in a row
Well just to show something cool
Bluring the scene, with text over top, with text having depth enabled :)
-
Were Cre8or games ever publishable? As in you can just click and play without Cre8or?j
-
Yes.
Cre8or was a program that made scripting for the KJX engine a lot easier (or, was supposed to, well if you put aside the bus then yea it did).
When you ran your game, it saved the scripts, models, other files and a copy of the engine in a folder, and all you needed to do was run the exe and it loaded up the scripts and files, running your game according to how you scripted it.
However, number 0.13 didn't have this as it wasn't a finished version (not like the others were anyway).
-
Right, so about two weeks and a half ago I got in touch with a car, we hit it off immediately, started dating and what do you know, the car was abusive.
In other words I was riding my bike and I was hit by a vehicle at a cross walk, ended up breaking my shoulder. So for the last two weeks and a half I haven't done any programing what-so-ever, as I can only type with one hand. However I was reading a lot of articles the past few days regarding algo's (the gansta way of saying algorithms ... GANSTA MATH!! :P), especially on matrices.
So there's my update to you, and I want to ask, does anyone know a good reference/link/article or whatever on applying , matrices (and understanding transform/rotation matrices) in programing? I want / need to know how to use them for things such as skeletal animation, reflections and such.
-
Cooldude, sorry to hear about your shoulder, and your bike. That sucks man. I hope you get feeling better soon and you can start using your arm again. Good luck ,and keep up the great work! ;)
-
PS: bike is fine ;D
-
Hey dude, here's an great resource for learning matrixes (rotation,translation,scaling,transformation,frustum,etc):
http://clb.demon.fi/MathGeoLib/reference.html
I'm using great part of this on my engine (most for matrix).
PS: The car is fine too? ;D
-
Thanks, and I'm pretty sure the cars fine.
I was biking faster than the car, and the car was just accelerating, so all the damage was pretty much done just to my arm.
I'll take a look into that link right now.
-
Hey dude, here's an great resource for learning matrixes (rotation,translation,scaling,transformation,frustum,etc):
http://clb.demon.fi/MathGeoLib/reference.html
Right, so I was looking at that, and I didn't get what I needed from it.
Basically, what I'm trying to understand is how to apply a matrix to a high poly model.
Every example/tutorial I come by is only applying it to one polygon only, when I'm needing to apply it to 100's and 100's if not 1000's of 1000's of polygons.
So how would I do that, leaves me with a ?
-
Hmm...Have a look here:
http://content.gpwiki.org/index.php/OpenGL:Tutorials:Basic_Bones_System#Rotating_a_bone
I'm not sure it will help, but it's quite hard to find an decent tutorial for opengl about this things.
PS: (i'm stuck at this too :P).
-
PS: (i'm stuck at this too :P).
Well at least I'm not the only one, and I seen that article before.
It mostly just goes on about the hierarchy system of the bones and making functions with them, which is incredibly easy.
Also the tutorial doesn't have to be opengl relevant, as long as you know how to use opengl you're good, which I do. Basically I'm trying to work out the math, rotate a huge set of points around a point, then I can take that data and I can go into a loop to get all the point data and render them using opengl.
-
I'm working on an solution here, i will post it later.
-
Here's it, all it does is rotates all points in array by an pivot at center (left-click mouse to see effect).
PS:It screws everything as always :P.
-
looksneatforsure,however I just found out your application kills my spacebar :P, and there is not a fps limit (it's just one giant blur), and you can still use the mouse in your application even when its not selected, so I can't really tell whats going on :P.
Well I was wondering if it would be possible to use ONE matrix for every polygon, but calculate each polygon separately. IE use the matrix to rotate this face, then use the same matrix (cleared) to rotate that face etc etc
So, right me and a friend are working on the site, yes the official site and forums.
So here's a picture preview of what it should/might look like!
PS: I realize there are several spelling mistakes in the place holders
-
Act 1:
Sorry I was working in an new coding structure and forgot the fps limiting, also i've accidentaly put the mouse part inside main loop, causing that crap bug, the space is an long forgotten hotkey for adding random geometry.
Act 2:
Having a matrix per polygon is quite memory and CPU expensive dontchathink? The main problem here is the non-uniform transform, because each point will receive it's ancestor rotation accumulated (quaternions accumulates rotations). Using a matrix gives the same result (don't know why).
final act:
Loved that theme ;D.
Credits:
LOL! & Associated
-
Act 1:
Lol
Act 2:
Yea, was thinking that, but wasn't quite sure how efficient it would be, reason why I wanted a article relevant to programing.
Act 3:
Thanks, I will work on more themes once everything is set up and working.
-
I thought this was an important update....
TYPING WITH TWO HANDS!!!
Yes, I can now start to type with both of my hands, although my arm is still not 100% healed, its healed enough to be able to start using it again.
In other words, I can type without (many) errors, and without taking 4394348578 minutes to do so!
So in more other words, I can start working efficiently again, so I can start to programing like MAD!!1 (lol'd at the 1 :P )
So I'm going to add a bunch of functionality, testing out some algo's here and there, as well as starting the script interpreter!
-
That's great!, now you hav no excuses to being lazy ;D.
-
Hi there cooldude! I'm thrilled to see this project! I was one of the other mods over on cre8or Fatal-Error. I'm not about to read through seven pages of stuff, but I get the gist that there still is no website for this awesome project yet (that and a quick Google search).
I actually am co-owner of a computer repair shop in Cranbrook BC (LTB Computer Solutions), we have a webserver setup there with virtualized user accounts and a bunch of other fun stuff (including email) I'd be happy to donate a few gigs of space on our server to host your site when you get it finalized. I'll chip in a few bucks to get you a domain name too, so you'd have your own .com if you have a few ideas I'll see if they're already taken or not.
I also am quite interested in what language you are programming the new (essentially engine I suppose) in? I presume C++, I'm quite proficient at vb.net, I coded the entire Point of Sale system we use at the store, it's all tied into a database, auto bills and all sorts of fun stuff. I'm not sure how much that would help your project, but if I can help I'll certainly be happy to do so.
-
Well there's someone I haven't talk to in a long time.
Good to see ya, congrats on the co-ownership, I hope business is good.
As for the server, it may actually be of some use, I will have to sink in the information in over the weekend, and try to figure out whats happening on this end (my friend is not getting as much computer time as usual, less than 4 hours).
Also, yes the engine is being built in C++. Runs on multiple platforms, for sure windows xp vista and 7, linux through wine, and theoretically mac (but not tested, and I don't I care about them).
To summarize up those some 7 pages of text, I'm keeping the same goal of cre8or, to have beginners as well as advanced users (in a method that will teach people about programing).
I am building my own scripting language, using my own interpreter parser and of course engine.
I am building my own shading language on top of the scripting, which essentially combines opengl 1.1 fixed pipeline functions, as well as things like perlin noises.
Supports for every key on the keyboard, plus controllers (including tilt axis, like on the ps3 remotes).
My own lighting functions (with infinite amount of lights using opengl 1.1), and the option to use opengl's fixed lighting functions instead.
(advanced) Font functions, as well as multiple fonts (at once) in 3d space and on screen gui.
And much much more secret stuff (that may be leaked :P) to come!
-
Long time no see Fatal, cre8oristhe here (
stupid non-sense nickname). Dude's project is getting bigger than i expected (no offenses) =P. I'm working in an game engine too, but it's for my personal use (also to promote autohotkey, language i'm using).
-
Well my long time no talk, hopefully will get back to programming hardcore again within the weeks to come but I have got some news to share.
First I acquired a new laptop, well new to me-ish. My (very nice) brother gave me his old laptop which is major upgrade from my old one (and I'm giving my mom one of my old laptops just have to do a few part transplants with the old laptops), so now I can work away from home without having the screen fall off YAY!
Second I got some ground work done for subdivisions (looks like nothing currently, but it does do something :P)
The subdivision will have two main parts to it, a normal tessellation with lod, and a algorithm to give it the smoothed effect (like what you get in anim8or)
Hopefully I will get some screenies up soon
-
That's great (i've thought you got hit by a car again =D). Hey dude, any progress in bone animation?
PS: can you send me that cre8or copy later (msn)?
-
I know what you mean about using an old lap top I run Anim8or under Windows ME. The poor thing is falling apart but still runs although it tends to crash a lot. I'm trying to budget some funds for a newer one myself. I can tell it's time to upgrade when I try to run newer software and I get an error that tells me the installer expected a newer version of Windows. Good luck with Cre8or though Leroy.
-
My old laptops a latitude d600 from 2002 (10's years old) running windows xp, I did have a laptop from 94-ish running (thinkpad), unfortunately my little sister massacred it ): (quite literally, damn 9 year olds)
-
I am extremely exited about this project.
I've never used Crea8or before, though, so will it be easy to understand for a newbie like me?
-
Yes, the goal intended is to bridge the gap between beginner programers and advanced programers. Technically there was no coding in the cre8or engine, it was all script based, which is as the same in my version, however I plan on making it very similar to coding.
So hopefully newbies that have never looked at a line of code in their life (or at least understood a line), will be able to use this.
Its somewhat similar to unity, except that this has more of a compiler feel and unity has more of a game that can make a game feel.
For terrain tools and what not, there are algorithm built into the engine that you use in a script, which is your tools, and as for when this will all be done
-
Well you wont be once this is complete ;)
-
still got a lot to do before beta. Right now Im working on the engine, and not the interface for project undead.
Currently Im cleaning up code, and making a function that will load up models on the fly in game (Im currently compiling models in actual code which is not efficient or fast to load).
Im also doing lots of research on multiple topics, but school is taking a lot of my time away.
I just fixed some of the fixed fuction lighting issues in opengl, and made infinite directional lights.
-
Small but somewhat big update.
Got a .obj loader during run-time to work, unfortunately its horribly slow and I have no clue why? So I am going to work on it some more, make it optimized, but I can say the code is a lot cleaner than the last version (didn't run in real time), and thus so makes it easier to fix and etc.
I learned how to access texture data directly (thanks for the help cre8oristhe/cre8orexpert ;) ), so I can make things like a paint program if I wanted to, and things like perlin noise.
I also got anisotropic to work, so now the textures are mipmapped and don't look blurry on certain angles.
Anyways, I promised screenies a long time ago (in a galaxy far far away ;D)
first one, I was testing loading up object files from anim8or,
The next three I modeled grass meshes in anim8or, and tested them in my engine.
-
This one Ive been meaning to post for a while, it was me just messing around :P
-
Awesome! that's all i can say :P.
ps: i'll be on msn all day, so i can help you with the .obj loading.
-
What do you mean by wizards?
As for the flat terrain, that's just my lazy arse way of making a bunch of squares, slapping a texture on them and making a set of them side by side. You could just load a terrain as an object file, for use some algorithms that I will implement that generates a terrain by height maps or whatever.
PS .obj files or more or less just for temporary use, I will be using anim8or files in the end, might keep .obj support however.
-
Quick update
Improved obj loading (with more help from cre8orexpert/cre8oristhe),
and greatly improved obj rendering speeds.
Also fixed the normal issue (the weird lighting issues some obj had).
SCREENIE!
By the way, that wall obj consist of 20292 faces and runs really efficiently.
-
Although I did improve the rendering times, they aren't to their fullest.
I realized this when I changed the tree models to something a little better and noticed a big difference.
-
oh, so you did some progress? i thought you're busy cleaning your room :D.
-
oh, so you did some progress? i thought you're busy cleaning your room :D.
No, that's a four year journey, from time to time I takes breaks from it to make my room messier :P
-
...be careful you stay on topic, cooldude
Oh you dont know how I work, do you :P
-
Oh thank gawd,
I got a new power supply after the last one in my tower completely went to charcoal.
Now I can continue my work, resume stuff and secret anim8or projects of mine ;)
-
Well...Okay but I have been warned about etiqqete (<---Not spelled right).....Uh...k...
Well not to underestimate the moderators powers, but I actually get work done by not staying on topic :P
So quick update, got a Frame rate per second counter in!
I also have lots of issues with performance, and I'm debugging lots of stuff.
Also I am going camping between the 3 - 19 so I wont be here :P
ALSO I fixed several lighting glitches, and made ground work for simple physics (like ray casting and such)
ALSO I have a picture.
-
Man, cooldude, this is looking sweeter by the day. Just wondering, this thing does have something of a user interface? What's that look like?
-
Well this is just the engine so far, the interface for scripting (what cre8or was) isn't actually made yet.
However I still have to address the performance of rendering object, a 1 frame per second game isn't going to be all that fun now is it :P
I know whats the issue, I'm essentially making too many calls to opengl and its clogging the pipeline slowing down everything. I just need a way to draw triangles without making many calls.
when I get back from my 2000 km trip (4000 km in total for going both ways :P) I will continue my work on it. (also I may have a another project I might post, but no promises)
-
Fixed the issue with rendering times.
Ive bench marked this thing, and Ive rendered over 1 million polygons (1,133,179 to be exact) with 9 frames per second, and this unoptimized, as well as there is a even faster way to render polygons which I haven't tried yet.
Currently working on ray collisions (with planes and triangles), if anyone can help make me understand these things (like line plane intersections and stuff), I appreciate any help :P
Anyways here's a screen shot displaying something rendered with these new rendering speeds.
-
I find it interesting to note the cre8or site is back up and running by kappax (Keith Tabert is his real name),
apparently hes working on a new game which is also on kickstarter.
www.cre8or3d.com (http://www.cre8or3d.com)
www.kickstarter.com/projects/wak/outeredge-voxel-based-fps-sandbox-survival (http://www.kickstarter.com/projects/wak/outeredge-voxel-based-fps-sandbox-survival)
So that's what he sounds like, well its good to see hes actually alive :P
makes me wonder if he's seen what I've been doing... *runs*
EDIT: it's down again and now some weird nonsensible post
-
Hello again Cooldude. We had such fun with the 3d calc last time, I thought I'd chime in again. Actually, just wanted to say that if you google "line plane intersection code" you'll a few useful hits. Easier than me typing it all out, anyway.
I may be a bit old school in terms of my gaming, but because collision detection can be quite computationally expensive there are a couple of tricks that tend to be employed to reduce the number of calculations.
Invisible bounding boxes around objects. Where each detailed model has an invisible, crude model associated with it that is used for collision detection. doing precise collision detection on a detailed 10k+ model is far more expensive than for a 500 poly blocky model, so it kinda makes sense. You see this in games all the time, where you can see a bullet's tracer missing/hitting something very clearly, and the game reacting to it wrong - what you don't see is how the bullet is striking the bounding box.
When shooting through objects games like railings or chain link fences, games will often treat the whole object as a 2 poly collision object and roll randomly to see if the bullet goes through unimpeded. E.g. the alien robot zombie is behind a metal railing, the bullet goes through railing space, then the enemy space, so at the railing space there is a 10% that the bullet stops. Rather than going through the expensive calculation of detecting the space of each rail individually.
Do an initial calc of which objects are even in the right area/direction and if they're not then don't even bother trying to do collision detection. Just makes sense, but it does need to be done.
You probably know all of this already, but I thought I'd just add it just in case. If you are having trouble with your frame count, then proper collision detection can have a pretty significant impact.
-
The site isn't back up and running, it's domain name expired yesterday (8-30-12) and now it's up for grabs. As for kickstarter, i got nothin'
Well for me the kickstarter is still up, and cre8or3d is down, but http://outeredgethegame.com/ (http://outeredgethegame.com/) is still up (his game website), weird how it expired yesterday :P
Water Music, I know quite a bit about the concepts of collision detection, its more or less the math side of it that gets to me :S
And I know what you mean by the expense of some methods, but trust me I'm not wanting to do box collision on the whole world, now would I, besides I know how to optimize collision detections so I can make it even faster.
As for using Google, I'm on page 5 looking through every link, and still don't understand these line plane intersections.
-
Oh my... what the... what is going on here?!?
Man you just made my day! I am an anim8or member from 2004 (?). I was watching the progress of cre8or day by day, hoping that something great will emerge... can you imagine my disappointment when I saw cre8or, then Polly, and finally anim8or ceasing development? So much time... It was enough for me to learn C++, OpenGL, linear 3D algebra!
And after those years, I finally realize that something, someone is still alive (or undead? :P) and working! Believe me, I want this to work.
If only I could be of any help... however I will be making a 3D elementary game till Christmas, so I will be 100% busy till then. But I really wish that after that I will be here, watching the progress, giving any possible support.
Please make this happen :) Ah, now that I know there is still hope I'm not leaving that easily! I'll be around until then.
Very happy to hear from all of you people.
-
Grass!
Yes Grass (with a capital).
Its been a while and I think this was a worthy screen shot,
so here's an update of the grass I was working on.
EDIT: also its anti-aliased at 16x
-
THAT LOOKS DELICIOUS.
-
lol ;)
I tweaked the texture a bit, and made the grass shorter for the heck of it
also it is anti-aliased at 4x
-
I've used the original Cre8or a bit. Looked promising, too bad he gave up on it.
I give you tons of credit for your programming skills.
I also like programming, but never got into game engines, mostly business oriented and
apps for personal use. (Borland C++, Delphi, Lazarus free pascal, and right now freeBasic
with an Irrlicht Wrapper). I'm not fussy lol.
You have a big task in front of you. Keep pushin, you're doing a great job.
-
You know what I just realized, I haven't had an avatar on this forum since I signed up.
And it's been more than a year since I started this project, man where has time gone
*toilet flush*
ah yes ::)
-
Well a few more screenies to end the night.
I added some more vegetation quickly, and I'm also looking for bugs in my engine.
-
It's great! Plants are a must in all games. I hope you made the grass height adjustable, 'cuz I wanted back then to make a game with a 'Booo I'm hiding in the grass' stage :D
No avatar?! While on such a project? We should make something for you! ...an undead robin, perhaps? :P
EDIT: AAAAH I SEE A BIG GREEN WORM ON THE LEAF!!!
-
Thanos, to make the grass adjustable, just make a grass mesh yourself.
common sense :-\
Nah, I actually said that because I (erroneously) thought that the grass was made with some grass generation algorithm.
-
Hm, I second the debunked belief that grass was something determined inside the program. HintHint.
-
Hehe, the grass was actually modeled in anim8or then looped in the engine, rotating the model here and there so it didn't look like it repeated it's self too much.
But I am working on a generation algorithm, it works the same with other plants, like trees and such.
Here's a screen of the grass in anim8or.
-
The texture makes it look very good.
If you need any tips or snippets for the algorithm, PM me... I have something in mind. (Crazy or not :) )
Unity? Not really... I once entered the site as a kid, but I soon got out, because it looked very... you know, big... and I still couldn't even handle GameMaker.
-
I pretty much already have the plant generation algorithm done, I just need to figure out how to distribute it over geometry.
As you seen in the images, its just being placed on a flat plane at y axis 0
-
Maybe follow the heightmap? (Although you probably already know this.)
@cello95: Seen it, liked it, suggested it! Nice tool indeed.
-
I,m not using height maps, I only have the vertex data of the mesh to work with.
-
Uh huh. So you want to place vegetation on a random object. ouch, bump. It will probably take a lot of thought.
Hmm maybe a workaround. I don't have any code in front of me, but it's the first thing that comes in my mind right now.
Find target x,z of the next plant. Shoot vertical ray and check collisions. Add faces collided with the ray in a list [<-- tough part - you have to first add the objects the ray finds in a list, and the shoot another ray for each object for face detection (I think)]. Find collision point with max y, store the face it was found on too. Find slope of stored face. Place the plant on x,y,z, rotate it with the slope.
I dunno. It looks kinda hard to me.
-
yea still don't have line plane intersections :\
-
Hey cooldude234, don't make line-plane intersections your top priority yet, I may come up these days with a .cpp containing this:
bool linePlaneInt (float3 * vert, unsigned int numv, float3 lv1, float3 lv2, float3 * intv);
The least I can do. :)
-
Here you are. :)
You'll have to adjust it to your needs before using it.
I DIDN'T thoroughly debug it, so if it doesn't work... uuh... tell me?
Thanks to Maxima for the hard math.
http://andrejv.github.com/wxmaxima/index.html (http://andrejv.github.com/wxmaxima/index.html)
-
I think I may have figured out something on my own, but I'll have a look at your code no matter. It never hurts to see other people's works (just realized that rhymed :P )
-
It's been a while, and a long long month it has been.
As trying to find a job (I'm out of a paid job :[ ) has been taking for ever, I've got no money and yeah, fun stuff.
But that doesn't I have quit working on the new cre8or, in fact I just found a performance defect, and fixed it. Apparently vsync was enabled, and apparently it takes quite the resources from computers or something. So I disabled it and instantly got about 8 times the speed, and I don't really see any tearing in the screen so it was useless to use it (will still add the ability to enable/disable it though, more power to the user is what I'm thinking). Now that I have stretched out this (supposedly) short post I shall stop typing here... or maybe here.... nah I think here... <- technically that . counts as writing so I'm going to stop after this period .
-
But you are not gonna stop writing, are you? :)
We're sorry to hear you are having difficulties too.
Just crossed my mind, what method was used so for making vsync? Was it WaitForVerticalBlank or something like that?
-
Just crossed my mind, what method was used so for making vsync? Was it WaitForVerticalBlank or something like that?
A function that's built into a library I am using, but before I wasn't calling it so my hardware just chose to use it automatically.
-
Hey Im new to the forum and I just recently acquired the version of cre8or that you all talked about...but i have windows 7 and it doesnt want to even boot up...is there a way i can get past this?
-
Yes, you can try compatibility mode, but if that doesn't work (and you have the proper .net framework) there's pretty much nothing you can do about it which sucks... a lot.
-
Another small update, no pics this time around.
I came up with a method for a cross platform high resolution timer.
I created a method of using the existing C++ clock by using some simple math. I can get how long it took to render a frame straight down to the nanoseconds (1 billionth of a second), and even beyond to things like a picosecond (one trillionth of a second).
As long as the computer can handle the number of digits in a variable required (which is a lot, and always expanding) it will work.
Getting the time it takes to render a frame is important if you want a non limited frame rate, and steady speeds.
What I mean is, the faster the computer runs the faster the game would run. So if you didn't cap your frame rate, your character (if you had one) would run faster than it would on a slow computer. But in this scenario I can take the time it takes to render a frame, and use that to slow down the values of things in the engine. So if your game ran at 12324 frames a second, your character would run the same speed in 3d space, as it would as if your game was running at 234 frames a second.
Okay I'm going to stop typing now, and shut up with the technical stuff. I'm just overly tired, excited that I got it to work, and I still have a stupid cold (but its much better now :D ).
-
It's been a heck of a long time since I've posted but I am really stuck with some math.
Now I have got bullet physics implemented into the engine, but bullet only allows triangle meshes (meshes made up of triangles) to be static; meaning they don't move in the world, rotate or anything, only objects get effected by it, and it doesn't get effected by other forces.
Bullet will allow dynamic (moving objects that get effected by forces) triangle meshes, but only if they are approximated, in other words if the vertices are averaged out and such. This is good for simulated game physics like objects falling and such, but this IS NOT good for ray collision and ray tracing for use in lighting, it is not accurate enough.
Now I've made a ray caster but I cant get ray collision to work in my own code (I can find a point on a plane that is the intersection between two points (a ray), but I cant find if it lies inside a triangle).
I would love if Steve gave some insight on the math he did to calculate ray collision in anim8or, but I know he'd never answer to someone on these forums ):
So I shall ask YOU, yes YOU, the READER of THIS post, is there any alternatives? Any suggestions?
Bullet is &#^*$&# me off and so is physic calculations, and I don't mean to be rude about it but I am not in happy mood with this situation.
-
anyone?
-
Google is your friend.
http://www.lighthouse3d.com/tutorials/maths/ray-triangle-intersection/
-
Been there done that.
That page didn't give me any good results and it never worked.
-
If you can't make this work,have you tried a math lib like glm.
http://glm.g-truc.net/
http://glm.g-truc.net/api-0.9.4/a00179.html
-
I've looked at glm before and didn't know it had collision.
But now the second question I shall look into, is it a good license.
EDIT: IE I don't want to use a whole library for one feature, especially when I worked hard at optimizing my math functions
-
Sorry for the late reply. I can give some help if I find time.
Tell me what exactly you mean "That page didn't give me any good results and it never worked."? What is the point that stops working correctly?
Also, how is a triangle defined in your code - to allow me write some compatible code? Like, ((x1,y1,z1),(x2,y2,z2),(x3,y3,z3)) (ie. is there a 'point' class? or maybe a 'triangle' class too?) Or raw data, like, (x1,y1,z1,x2,y2,z2,x3,y3,z3)?
EDIT: Oh also, how is the ray line defined? Point-and-direction or two-points-on-line? (Is there a 'ray' class or 'line' class? Show me.)
-
Triangles and their vertices are always defined the same way (if being traditional geometry), just by 3 points with a position for each dimensions, which in this case is three (3D). No matter if the vertecies are in a class, namespace, or structure of some sort, you can always get the floating point values form these vertices.
However the ray is a little different because you can define it by a point and direction, or by two points. In my case its by two points.
Now I've searched many many sites, and went though about 40 (search)pages on google.
I've got line-plane intersections to work. But that's only good if the plane is an infinite plane, so I need to detect whether the point is inside the triangle or not.
Also the method I'm using is probably not the fastest (A LOT of conversion and abstract math, it could be simplified).
I'm trying to look through the glm source code for some answers.
-
Here you are. ;)
I think the code I once sent you for line plane intersection might have a bug. I tried avoiding it this time, do a test if you want.
EDIT: Oh my, where are my manners?
Return values: x, y, z: collision point.
Return value is a boolean indicating whether the point belongs in the triangle or not.
EDIT 2, 16/2/2013: This version had a bug, so I removed the attachment. See version 3 for an update.
-
Yea in my code I have setup the functions for plane intersection to return true if intersected and I use pointers to cast the collision point to the variable I wan't to store it in.
But anyways thanks I'll try in my code when I have time tonight.
Though I must ask what is with the Boolean variable rti? It's defined just to define floating point values. Why not just define the floating point values?
EDIT: I lied, I spent an hour and a half playing lone survivor, but I'm working on the code now so it counts I guess :P
-
I tried the code and it still doesn't work.
Everything is fine up until I try to get it to find if the point is inside the triangle.
its making me really mad >:(
EDIT:some debugging led me to find out that (x-a)*a+(y-b)*b+(z-c)*c >= 0 is outputting values like -33 and -40 when the others are outputting stuff like 0.456 and -0.2357
-
Though I must ask what is with the Boolean variable rti? It's defined just to define floating point values. Why not just define the floating point values?
DUH!! It's not a variable! rti() is the complete function ready - made. You don't have to edit it! :P
rti() returns if the point is inside the triangle. I've already made it! see below for an example.
Example of use.
suppose we have, a triangle with points (1,2,3), (2,3,4), (3,4,5).
and a ray line from points (3,2,1), (2,0,1).
Rename rti.cpp to rti.h (should have done this myself - sorry)
And in your main program:
#include "rti.h"
...
float xi, yi, zi;
...
inTri = rti(1,2,3,2,3,4,3,4,5,3,2,1,2,0,1,&xi,&yi,&zi);
if (inTri == true)
{
// The point is in the triangle.
// The point is (xi,yi,zi) - do something with it!
}
else
{
// The point is not in the triangle.
}
-
whoops I read it totally wrong. But it didn't really matter I added the code into my own function anyway
But it still didn't work
-
Doesn't Thanos's function work standalone? If it does then it's a problem with the input, and you need to recheck how you are using it.
-
I might make a small example application as well, just to make sure it works standalone.
You know, I shouldn't be sure about anything:
Programmer's rule #1: "Thou shalt not expect thy code bug free."
EDIT: Uhh :-[ :-X it seems it needs just a tad of debugging, I'm sorry cooldude234!!
-
Doesn't Thanos's function work standalone? If it does then it's a problem with the input, and you need to recheck how you are using it.
I might make a small example application as well, just to make sure it works standalone.
You know, I shouldn't be sure about anything:
Programmer's rule #1: "Thou shalt not expect thy code bug free."
EDIT: Uhh :-[ :-X it seems it needs just a tad of debugging, I'm sorry cooldude234!!
Yea, it would really help if I understood the math to this whole thing. I can't tell if it's something wrong with my code, the code I based my code off of, or thanos's code or if the universe just like messing with me :S
-
Ok I found 1 bug so far, if the line is vertical, the tangent of angle is infinite,... so it's blown up. I should try to find an alternative way to describe the line.
-
Ok I found 1 bug so far, if the line is vertical, the tangent of angle is infinite,... so it's blown up. I should try to find an alternative way to describe the line.
??? :S ???
-
EDIT: Uhh :-[ :-X it seems it needs just a tad of debugging, I'm sorry cooldude234!!
I meant that my code needs debugging, not yours. :D Yours is probably ok. I have little time this days because of exams, but I'll find some soon to do more tests to find the other bug too.
??? :S ???
Um in other words there is a chance of division by zero in my code. :)
-
if there was a division by zero then the code would crash (the program would just stop running and close), and VC++'s debugger would recognize the crash code and tell me it was a division by zero.
And I know that you mean your code, but I have no clue what you said by...
Ok I found 1 bug so far, if the line is vertical, the tangent of angle is infinite,... so it's blown up. I should try to find an alternative way to describe the line.
something about the tan of the angle is infinite, which I don't even know how that's possible and I just don't understand it.
-
if there was a division by zero then the code would crash (the program would just stop running and close), and VC++'s debugger would recognize the crash code and tell me it was a division by zero.
Yes, in integers it would crash. In floats however the float variable gets a special value, #inf. Processing this value usually gives #nan (not a number), which makes things stop working well in general. I'm not sure if we are testing the same input though.
And I know that you mean your code, but I have no clue what you said by...
Ok I found 1 bug so far, if the line is vertical, the tangent of angle is infinite,... so it's blown up. I should try to find an alternative way to describe the line.
something about the tan of the angle is infinite, which I don't even know how that's possible and I just don't understand it.
An example in 2D: a 2D line is described by y=ax+b. a is equal to tan(t), where t is the angle of the line. A vertical line is x=c. How much is a here? There is no a here, but vertical means, t=90 deg -> a=tan90 = #inf... unless you use different system to describe the line, without a and b.
Same for 3D.
-
An example in 2D: a 2D line is described by y=ax+b. a is equal to tan(t), where t is the angle of the line. A vertical line is x=c. How much is a here? There is no a here, but vertical means, t=90 deg -> a=tan90 = #inf... unless you use different system to describe the line, without a and b.
Same for 3D.
0.0 .....Ummm yea I don't get it
-
Ah never mind I just used an if-branch for the division by zero.
I found the second bug too!! And it was SUCH A DUMB BUG :-X
So, cooldude234, here is ray-triangle intersection, version 2, I think it works ok now - I'm sorry I was that slow! I had some exams to sit these days. I hope it serves you well! If you find another bug, just let me know.
EDIT 2, 23/2/2013: Nope, this didn't work too. See version 3 for an update.
-
IT WORKS, sort of.
Everything is flipped on the z and x axis (when I draw something on the right side of the 0,0,0 worlds origin, the collision happens on the left side).
Now this is just stupid, I flipped every number I can and it either breaks, or does the exact same thing. I flipped the vertices and the collision point and it does the exact same thing ??? what the heck?
Also I don't mean to pester but can you go through and explain in the dumbed down version what your method of checking to see if it lies inside the triangle do? (by the way I'm using a different method of checking collision with the plane).
-
Alrighty I got it to work, and I found out it doesn't work.
In other words I fixed the flipped axis issue but the checking if the collision is inside the triangle only works on 90 degree angles, on any other angle it screws up.
So now I'm right back to where I was before with all this stuff (several other methods only worked on 90 degrees, actually they may have been the same method but with just different implementations of it).
So... any thoughts?
-
Oh boy... you're right, there's still another bug. Please be patient, I'll track it down.
What coordinate system are you using? x=right, y=up, z=back (standard)? x=right, y=up, z=far (flipped - probably not)? or maybe x=right, y=far, z=up (the best imho but nobody uses it)?
What I'm using. We know that two vertices have the same direction if their inner product is positive, the opposite direction if it's negative, zero if they form a right angle. Ie. if they form a 45 deg angle, x1*x2+y1*y2+z1*z2>=0, whereas for 120 deg it's <0.
So, if we take the vectors starting at the midways and ending at the corners, a point has to be 'in front of them' to be inside the triangle.
See the pic for an example. The dot inside the triangle is in front of all the sides, so the inner product with the red vectors will be positive in all cases. Instead, the blue dot outside is in front of the left and the down sides, but the right side looks the other way, so the inner product with its red vector will be negative.
Of course all vectors have to be relative to the midway before calculation (the second bug I corrected).
-
Okay that makes a little more sense (I get the algorithm just not that math still :\ ).
I am using the standard xyz as the right, up, back (it makes the most sense to me).
EDIT: so why isn't it working on non 90 degree angles?
-
Progress report, I just want to let everyone know that there is still progress being made.
I got sound working after 8 hard crucial months of trying to work on it.
So I'll be working on the sound engine slowly now. I'll be making algorithms to assist in calculating sound in 3D space. I'm also going to try to work on effects like reverb (echo) and such.
Right now there is support for playing wavs, oggs, flacs and whatever the heck you can think of (except mp3's they're patented and you have to buy a license to use it for commercial use, which is a load of bull poop I think). Surround sound is supported but just not working fully (as I'm only playing sound on 2 channels right now, having issues with my specific sound api devices on my computer).
I'm using the libsndfile and portaudio libraries to make this possible (thanks to the people who made them, and made them free!), meaning I'm processing and calculating all the wave form data myself (meaning there's a huge control I have over the audio, if I want to add reverb I can etc.)
EDIT: still stuck on collision though :S
-
EDIT: still stuck on collision though :S
Don't worry, I'm not dead yet... I'm just a little bit stuck.
-
When it comes to collision everyones stuck...
it's as if they hit a wall
GET IT? hit a wall, because it's COLLISION :P
-
LOL I see what you did there :P
-
Hey dude, it's great to see your engine progressing ;D. I will start to help you again soon, not so soon, right now i'm studying tcp/udp to able to build multiplayer games (including an online card game, that will certainly be my first completed game, i hope :P). So give your best and don't forget to rest! :D.
Off-topic: I was a bit worried about you, but it looks like both your personality and thinking is intact ;).
-
lol, why would you say that, I'm not the one that went missing of the face of the earth :P
-
RTI V3.
I changed the equations. This solves a lot of bugs, and also gives a simpler code.
If it still makes a bug, give me your input and I'll try to reproduce it.
EDIT 27/2/2013: Another bug. DOH
Removed attachment, look for v4.
-
Looking at the code and equations, it's well written and should work now. In case this doesn't work, you should give a look at how you're constructing the ray ie: converting mouse (window) coords to 3d. Mixing degrees and radians can also lead to errors and wrong output.
PS: I didn't test your code Thanos, i've just formatted my machine and my super 128k dial-down disconnection makes me unable to download a compiler ;D.
-
Hey your back cre8oristhe (I'm still going to call you that :D )
Anyways, I sent you my code through PM thanos, also I noticed an error in my code, fixed it and it didn't change anything ??? (I had y5 = (Vert2.y+Vert2.y)/2; intead of y5 = (Vert2.y+Vert3.y)/2;)
And I still don't really understand any of this code, like what are the triangles midways?
What is half of this code even doing, I have no clue?
Also I would like to add, that the collision also doesn't work on 90 degree angles as well, it's just less noticeable.
What happens is around the edges of where 2 lines on the triangle meet (at the vertices) you can just go straight through them, but at the center of the triangle you can't.
-
Lol (i hate you :P), i don't know of this will change anything, but try normalizing the ray direction (Ray2 in your code dude). Also PM me with the code you're using to build the ray.
-
I'm just using two points for my ray, as shown in my code. From that you can could make a ray and normal direction from it if you really wanted to.
So all I'm doing to do build the ray is define two points in 3 dimensions (x,y,z), those two points form a line, or in this case a ray.
try normalizing the ray direction
That wont do any good, because then you'd be colliding with stuff way after you went through it.
-
Got it!. I'll take another look here, it would help a lot to have a compiler :P.
-
When you say you don't understand half of my code, you mean the first half (finding the collision point) or the second half (checking if it's in the triangle)?
Also, did you try rti v3 and it still doesn't work? Because I think it works ok for me (see the example file in the zip).
I'm checking your code now.
EDIT: See image, red are what I call 'points at corners', blue what I call 'points at midways' (actually called midpoints ::) )
...and, what I call 'internal product' is uh, the dot product.
EDIT 2: Ok, I think I start to see what is different between the codes. Here:
if ( (Dist1 * Dist2) >= 0.0f)
{
// line doesn't cross the triangle.
I thought you meant that the two points define an infinite line. It now seems you meant just the line part between them, right?
EDIT 3: Wait a minute... you don't have to invert x,z, do you? I think it should work without problem anyway.
Can you give me an input to test? (one you know it doesn't work)
-
When you say you don't understand half of my code, you mean the first half (finding the collision point) or the second half (checking if it's in the triangle)?
I refer to all of it, although I am using my code for finding the collision point only because I understand it and I know it works.
Also, did you try rti v3 and it still doesn't work? Because I think it works ok for me (see the example file in the zip).
Yes I did try it, still doesn't work.
I thought you meant that the two points define an infinite line. It now seems you meant just the line part between them, right?
Well I'm getting the collision point on a line that is formed between two points (so I can do area ray casting, I.e. a ray can be "fired" and take time to reach from one end of the world to the other by moving)
But that shouldn't affect checking to see if the collision point belongs inside the triangle should it?
EDIT 3: Wait a minute... you don't have to invert x,z, do you? I think it should work without problem anyway.
well for some reason I had to invert the x and z because what visually was being shown (the triangle) and where the collision was occurring was on the separate sides from the words origin. However I don't see how that would effect the math, only the outcome.
Can you give me an input to test? (one you know it doesn't work)
What do you mean input to test? Like compiled code, like an exe?
-
What do you mean input to test? Like compiled code, like an exe?
No, no... just a test case that produces wrong results, for example something like, triangle points: (0,0,0), (5,0,0), (0,0,5) line: (1,-1,1), (1,1,1). I can put your input in the debugger and see where it stops working correctly.
-
well I have the vertices of the two triangles at
Vertex1.x = 0;
Vertex1.y = 0;
Vertex1.z = 0;
Vertex2.x = 6;
Vertex2.y = 0;
Vertex2.z = 0;
Vertex3.x = 6.3;
Vertex3.y = 9.1;
Vertex3.z = 5;
Vertex12.x = 5;
Vertex12.y = 0;
Vertex12.z = 0;
Vertex22.x = 0;
Vertex22.y = 0;
Vertex22.z = 0;
Vertex32.x = 5;
Vertex32.y = 0;
Vertex32.z = -5;
It's failing (like I said earlier) near vertices, it works if your dead on with the triangle but not if your close to the vertices.
EDIT: I would suspect floating point inaccuracies could be the cause, but with the size the each triangle, and considering the precision of a 32 bit floating point (which can store up to 7 digits after the decimal) this cannot be the case.
-
Oh, oh I found the bug. I'll post a new version once I fix it. Thanks for the input, it helped.
(If you're curious, rti3 code was made to work only with equilateral triangles... [What on earth was I thinking?] Anyway, I'll have news soon.)
-
Ok, fixed...
cooldude234, I PM'd you with your fixed code. :)
For the rest, rti v4 is attached below.
(Work this time... plz... ;D)
-
okay a bunch of stuff has been changed as I can see.
Just a couple of questions, I might do some debugging my self to get another view point on this,
but which is the faster method for getting the plane collision?
Also what method are you using (I really don't understand any the code too much), is it this method you are using?
http://geomalgorithms.com/a06-_intersect-2.html (http://geomalgorithms.com/a06-_intersect-2.html)
Right now I'm trying to figure out how a, b and c are being represented as the plane, because the math that you used to make the plane defined by the triangle is exactly the same as the code I used for finding the normal of the triangle (by getting the cross-product). But you cannot have a plane with the normal, you need a point as well to define the position (I use the first vertices read because its quick and easy, it doesn't matter which it is anyways).
But none the less thanks for the code, once I figure out what numbers need to be used, I'll get it in my code and test it out, hopefully it will work.
If you're curious, rti3 code was made to work only with equilateral triangles... [What on earth was I thinking?]
LOL, yea I don't ever think a equilateral only collision algorithm is going to be useful to me :P
-
I just tested your code, it doesn't work. It apparently has a collision really messed up, it seems to have collision in a random place on the plane, and the collision spot is smaller than the actual triangle.
I'll do some more debugging.
-
I just tested your code, it doesn't work.
DOH. :-/
Did you also test the code I sent you in the PM and it still doesn't work?
Also what method are you using (I really don't understand any the code too much), is it this method you are using?
http://geomalgorithms.com/a06-_intersect-2.html (http://geomalgorithms.com/a06-_intersect-2.html)
Nope, the method I use is based on solving linear systems of equations. I might upload some explanation later.
Right now I'm trying to figure out how a, b and c are being represented as the plane, because the math that you used to make the plane defined by the triangle is exactly the same as the code I used for finding the normal of the triangle (by getting the cross-product). But you cannot have a plane with the normal, you need a point as well to define the position (I use the first vertices read because its quick and easy, it doesn't matter which it is anyways).
You forgot 'd'. (a,b,c) is indeed the normal of the plane. But, a*x+b*y+c*z=d is what describes the actual plane. I put it in a linear system with the other equations (lines etc) and new results are produced. The assignments I do (abcd,a1a2 etc) are actually the solutions of the linear systems.
No, of course I didn't solve them myself. get wxMaxima from here: http://sourceforge.net/projects/wxmaxima (http://sourceforge.net/projects/wxmaxima)
The code for finding the collision point is correct, I've tested it many times. Now, what happens with the code for checking if it belongs in the triangle... that's another weird problem.
EDIT: wait, what do you mean 'the collision spot is smaller than the actual triangle'?
-
The code you sent the pm was exactly the same as the one you sent in the post and d is never used for testing if the point is inside the triangle.
The code for finding the collision point is correct, I've tested it many times. Now, what happens with the code for checking if it belongs in the triangle... that's another weird problem.
EDIT: wait, what do you mean 'the collision spot is smaller than the actual triangle'?
Yea the issue I'm having isn't finding the collision point, but just whether it lies inside the triangle or not.
Also what I mean by the collision spot is, the area of collision (the area where you can collide with the object) doesn't match up with the triangle it's self (previously it was close, it just didn't match near the vertices), here no matter what it appears to be flipped on the x (or maybe z axis, maybe both?) and is about a third of the triangles size.
EDIT: I may have fixed it. I took out some code that probably was scaling it out of proportions, and I also fixed it's flipped axis once again (it also had to do with that weird code). It seems to be working, but just a little minor thing. I have two vertices joined together, and I keep falling between them at where their joined. I thought checking if greater or equal to was supposed to check if its on the edge as well?
EDIT: there seems to be some issues when I put it into an object, I not sure whats happening so I'll do some more debugging, but it doesn't seem to be working again ):
-
d is never used for testing if the point is inside the triangle.
Oh yes, for testing if the point belongs in the triangle I didn't use d, but the plane's normal plus a vertice that belongs in the plane (Vert1/2/3).
EDIT: there seems to be some issues when I put it into an object, I not sure whats happening so I'll do some more debugging, but it doesn't seem to be working again ):
): I'll test it again too... but I've failed so many times that I'm not anymore sure if I'll do anything useful...
-
Don't give up Thanos, one day you will be playing a game made by dude's engine, see a awesome collision, and think "hey that's my code!", while mankind is being annihilated by an alien spaceship from sector XD-123 and cooldude234 is happily laughing at how much he sold earth for. Hey robert, are you working in something else, other than physics and sound?
PS: I need to stop drinking so much coffee.
-
I'm always working on various things. A lot of it is structure, I'm working on an entity structure (an entity manager), and various things like that. Unfortunately a lot of things I need to work on like lighting all depend on collision, and accurate collision to what you are looking at. Because of this, Bullet physics, Havok physics, and even Nvidia's Phyxs is not suitable (they can only do triangle collision with static meshes).
Think of it as ray tracing. I'm pretty much trying to do ray tracing and need to detect when the ray hits the triangle (it's actually not ray tracing, but something that uses the same concepts).
Other things are being worked on such as,
texture manager,
audio effects (real time reverb and such),
an advanced lod system,
methods of volumetric rendering (besides iso surfaces/ polygons),
video playback as textures,
texture generation, like perlin noise (remember that cre8oristhe ;) I got it working)
I'm also learning about matrices and skeletal animations (I may get back to you on that cre8oristhe, well considering your on Skype as I type, yea :P).
And a bunch of smaller stuff that I cant remember (I have them written down somewhere).
EDIT: of course I forgot the scripting part (that's where the user shall have control over everything).
EDIT: Most of this stuff is working in the math, but just needs to be implemented or made faster.
-
Sorry for being idle, the semester has started and I had to cope with it.
cooldude234, can you please give me again an example input to test? i.e. 3 points of a triangle and 2 points of a line that you know they produce wrong results? Because I made many tests and it works so far flawlessly.
-
what it does is when I move the camera (it has a wasd first person movement style and I'm using the cameras movement to form a ray to test collision so I can easily see the collision), it locks onto a plane of a polygon that I am no where nears for a split second. I know this isn't lag because I purposely debugged this to check that.
Also the edges of the polygons don't necessarily work, when I have two polygons 'attached' and I have the camera move against it and it falls between where the polygons are joined.
Now the speed of the applications runs a little slower but faster than what I was expecting, however this is because I am calculating collision to about 800 faces every frame, this could be easily fixed by instancing and quantizing the polygons into sections making a hierarchy of polygons closest to the ray (in other words calculating if a collision occurs only to polygons that are close to the ray).
Sorry for being idle, the semester has started and I had to cope with it.
Don't worry about it, it's not like I'm paying you ;) thanks for the help none the less
-
I got a little bored with some things and I decided to try making split screen, it works good. I just got to figure out how to structure it into an useful easy to use function to be scripted. Which reminds me, I got to get around to actually getting some form of scripts being executed.
-
I really want to see this bug solved, so I started making a small ray tracer based on line triangle collision, to verify the causes visually.
(Who knows, it might prove useful later too.)
EDIT: Of course you're not paying me :P that's the point of FOSS. A paid coder wouldn't make a whole program to solve just a bug. ;)
-
besides that I don't know what FOSS means, thanks thanos. As I said the only things I notice out of place is that the seems of the triangles aren't all that great, you can go straight through them, its like a 0.1 gap between them, and the other thing is that it sticks on the planes of the triangles for no apparent reason(although I can still move, it just sticks for a split second).
-
http://en.wikipedia.org/wiki/Free_and_open-source_software (http://en.wikipedia.org/wiki/Free_and_open-source_software)
I made it... it renders a black screen, so it seems the function returns always false. Weird. Maybe some more bugtracking will show the cause.
Are you working on other things meanwhile?
EDIT: Oops, it was a bug outside the function... my fault... please stand by.
EDIT2: Still black. :(
EDIT3: Ok, working... I'm now trying to convince WinGDI to display it on screen. Somehow!
EDIT4: AH finally!
cooldude234, could you please run this on your PC and send me the result? Double clicking on the window saves the image in C:\test.bmp.
The attached test.png is what I get. Edges look OK here. Also the bright line at the middle is a good sign. We'll see if this is a matter of different pc architectures (I doubt it).
EDIT5 tart.exe had a bug, I uploaded new version below.
-
I cant even run it, it's missing a dll called libgcc_s_sjlj-1
and yes I am working on many stuff other than this.
Recently I worked on some of my orthographicall functions for making a better GUI system, I also worked on finishing building one of my instruments and I'm also working on finding a job ;)
-
You have a busy life :) that's good.
Pardon me for the last one, I should have used -static-libgcc and -static-libstdc++ options while linking. Try with this one.
PS I added two flaps at the sides, don't get surprised if they magically appear on the screen :P
-
Here it is ;)
PS: .bmp format is not allowed on the anim8or forums :S so here's a jpg screenshot
-
It works perfectly. Makes no sense. Are you sure the error is in the line - triangle collision code?
I remember writing some code for 2d collision back then... the problem wasn't in the collision detection method, but in the code that was using it. I mean, maybe it's not a matter of how you find the collision, but what you do afterwards.
-
AH HA, I figured out why certain triangles worked, and other did not
Apparently certain sizes and angles in certain locations just don't work at all.
Now beyond that I have no clue why that is.
EDIT: did some more testing, and quite literally this is the opposite of floating point in inaccuracies, it's literally just the size of the triangle that causes issues
-
Long time no screens :P
So I've somewhat gotten polygonal distribution (this is what I'm calling it, there's not really any name for it) working. I can distribute objects onto a polygon of any size at any angle, however it doesn't want to stay inside of the triangle (so I guess I still have some bugs to work out).
It does run decently fast (and there's a lot of things I did which slowed it down, meaning there's lots of room for optimization).
I can distribute a 1000 random objects and have the engine run at about 20 - 30 frames a second. Distributing 200 objects was around 80 - 95 frames, and it probably would have ran much faster if I didn't render the object (I could also optimized the way they're being rendered to speed it up).
So here's the screens,
-
I fixed it a bit... err maybe?
It seems to work, except the one corner has more of a probability to have objects near it than others. I believe this has to do something with the scalar value I am using in my algorithm. But non the less it is a much better result than previous attempts.
EDIT: getting 130 - 150 frames a second, whilst calculating 250 random positions on the triangle every frame
-
okay so maybe I don't really know whats going on beyond the code.
I replaced the distance variable (which is supposed to define the size of the triangle and later be used for picking a random point inside that) with a value of 10.
This is what happen.
I think I'll look over everything again :P
-
5th post in a row? eeeh I wasn't expecting this much progress all at once :P
Well doing some debugging and some math in my head I finally realized the full picture of the mess I had made ;)
See the image below for reference.
(get ready for not that much math :P)
The way I had designed this algorithm is so that you would get the distance of the edge, 1&2.
Generate a random number between that value and zero. Find the scalar of that value (so if the number was half of the distance of edge 1&2 the scalar would be 0.5), apply that to the second edge (by multiplying the distance of 1&3 by the scalar). So that way there would be a random point on both edges with the equivalent scale. I would then find a random point on the distance between the scaled lines, find the scalar from that, and project one of the scaled lines (depending on the order) by that number (scaled line multiplied by new scalar).
I'm doing what seems to be half of that, because of the way I implemented the U and V coordinate system (to fit a triangle instead of a square), I kinda made a interesting matrix operation for triangles :P (once again just look at the image below).
Sorry if you don't understand, I just suck at explaining things without making a picture book about it :D
NOTE: the matrix operations part was a joke, I'm just too tired to decipher whats funny and whats not
-
Okay, Great news to share to you I have!
I have fixed it and now it works perfectly.
What I did was a made an exponential value based on the V value (or U on the whiteboard). So the smaller V gets the more spacing there is between each segment. (now there's a lot of overlapping in this next image because I'm drawing about 500 objects in place, but that's just because I was too lazy to remove the random function part :P)
And I can easily change the distance between each segment (I guess that's what I could call it, segment that is).
Just take a look :D
EDIT: okay my exponent isn't working like I initially thought (I need to find the formula to scale it properly when changing the distance between each segment) but I am on the right track (I hope :P )
EDIT2: lol I know why my exponent is not working, duh the triangle is variable in shape and size, so I should't be working making the exponential decrease based on one edge (basically I need the size to be relevant to the world space in this case).
EDIT3: heheheh my post count is 555 :D
-
Okay so collision is slightly back to the title of slightly working.
Apparently the collision works, but the position of the physical triangle and the visual triangle are very off, and in a non constant manor. Meaning that one triangle has it's collision below, meanwhile another has it's collision to the right of it?
A least I got a taste of some sort of accomplishment.
Also working on making font's look nicer and less pixelated.
EDIT: Also it seems that closer to the origin of the world (x0,y0,z0) the less distance there is to the polygon and it's collision and the further away the more distance there is. (reason why the large polygons seemed to have issues over the smaller ones, because the smaller ones were near the center :| )
EDIT: I've pinpointed it down to the fact that the physical polygon and the visual polygon are displaced on its normal. IE take the visual polygon, go backwards along it's normal and at some point you will hit it's collision.
Also it seems that the end section (checking to see if the collision is inside the triangle) isn't wrong, nor the part for calculating where the collision is on a plane, but rather somewhere in between that. THIS IS GOOD though, because now I know where in the code this headache educing poop is dwelling.
-
You're seeing some light about the collision issue? That's great! It was making me feel kinda down.
-
I know that feels bro ;)
-
Well still can't figure it out, so I'm going to freely post the code for anyone to take a look at it.
NOTE: this doesn't make the project open source ;) and this is only the portion of the code that checks a ray and plane collision (which is the part not working).
bool CheckLineTriangle(vector3f Vert1, vector3f Vert2, vector3f Vert3, vector3f Ray1, vector3f Ray2, vector3f &ContactPoint)
{
vector3f Normal;
vector3f IntersectPos;
// Finding Triangle Normal (by using crossproduct)
Normal = crossproduct (subtract_vector(Vert2,Vert1),subtract_vector(Vert3,Vert1));
// Find distance from ray1 and ray2 to the plane defined by the triangle
double Dist1 = dot_product(subtract_vector(Ray1,Vert1),Normal);
double Dist2 = dot_product(subtract_vector(Ray2,Vert1),Normal);
if ( (Dist1 * Dist2) >= 0.0f)
{
// line doesn't cross the triangle.
return false;
}
if ( Dist1 == Dist2)
{
// line and plane are parallel
return false;
}
// Find point on the line that intersects with the plane
IntersectPos.x = Ray1.x + (Ray2.x - Ray1.x) * (-Dist1/(Dist2-Dist1));
IntersectPos.y = Ray1.y + (Ray2.y - Ray1.y) * (-Dist1/(Dist2-Dist1));
IntersectPos.z = Ray1.z + (Ray2.z - Ray1.z) * (-Dist1/(Dist2-Dist1));
ContactPoint = IntersectPos;
}
And here's the math functions used in it
float dot_product (vector3f A, vector3f B)
{
return ( (A.x * B.x) + (A.y * B.y) + (A.z * B.z));
}
vector3f crossproduct(vector3f A, vector3f B)
{
vector3f vector;
vector.x = (A.y*B.z)-(A.z*B.y);
vector.y = (A.x*B.z)-(A.z*B.x);
vector.z = (A.x*B.y)-(A.y*B.x);
return vector;
}
Also vector3f are just a 3 floating point vectors (in other words they are a variable that contains a x y and z)
-
First off I just noticed this topic has 10901 views (wholy craps :o)
Now onto the original reason for posting; just a little bit on what I plan to do.
So I plan on making this engine module based. Meaning you can take out and add in parts to fit your needs.
Because games (and programing) in general don't have one specific way of doing things and instead they have algorithms that they use to fit their specific needs; I'm not going to take a 'one size fits all' motto. However I do want the engine itself to be a universal tool to make a wide range and variety of games (from FPSs to RPGs, 2D plat-formers and even text adventures :D).
So module based is the way to go, and a good example of this would be shadows. For instance you wouldn't compute shadows the same way you would in a 3D First person shoot than a 2D rpg game would you? Of course not. So what I would do is I would make two algorithms for shadows, one that would take 3D space coordinates and one that would take 2D Coordinates and then compute them efficiently for each case.
Now there's a bit more to it than that (on the technical side), and I don't exactly know what direction I want to take this moduleness in :P. I might use separate DLLs for things like 2D physics and 3D lighting, 3D rendering etc. That way you can exclude whatever parts you are not using from the exe folder and it would run fine. However this is truly dependent on how big the exe is in the end (right now all the functions are compiled inside the exe). If the exe is something like 30 megabytes then I will make separate dlls for it.
Now you may be thinking but 30 megabytes is nothing for a hard drive (or ram) but that's not the issue. You see when you run a program, like an exe that program doesn't actually go into the ram (or is ran from the hard drive). It is put onto your CPU, well your CPU's built in memory anyway. And if your exe is too big and can't fit onto the cpu then it will go onto your ram card (and this SLOWS things down BIG time, it's not good to have). So in short the smaller the exe the better.
Well that's the small update I can give you, it's not much but it's a little insight to my plans for the future of this project.
-
cooldude234,
Whenever I have tried to determine whether a line segment (like an edge) intersects a polygon, I have done it in two steps:
1) determine if and where the line segment intersects the plane of the polygon
2) determine if that intersection is actually inside the polygon
It is unclear from your code segment what Ray1 and Ray2 actually are, but if they are points that define a line segment, then this is how I would solve this problem:
facenormal=normalize(crossproduct(vert3-vert2,vert2-vert1)) //get normal of polygon plane
rayvector= ray2 - ray1 //get vector of ray line segment
ray_plane_angle=dot(facenormal,rayvector) //actually the arccos of the angle between
if ray_plane_angle != 0 //if zero, the two are parallel
ray_plane_intersection_point = ray2 + ((dot(vert1 - ray2,facenormal) / ray_plane_angle) * rayvector
//above, calculate the intersection point of vector of the line segment and plane
//next add angles of intersection point to two of the vertices at a time.
//if the angles add to 360 deg (or 2*pi rad) then inside, otherwise the intersection point is outside
total_angles= acos(dot(normalize(vert1-ray_plane_intersection_point),normalize(vert2-ray_plane_intersection_point)))
+acos(dot(normalize(vert2-ray_plane_intersection_point),normalize(vert3-ray_plane_intersection_point)))
+acos(dot(normalize(vert3-ray_plane_intersection_point),normalize(vert1-ray_plane_intersection_point)))
if (abs(total_angles - 2*pi) < 0.001) contact_point=ray_plane_intersection_point
If you are actually dealing with a line segment, rather than an endless line, then you need to check whether the intersection point is actually between ray2 and ray1:
if length(ray2-ray_plane_intersection_point)+length(ray1-ray_plane_intersection_point) > length(ray2-ray1)
//intersection point is not between ray2 and ray1
I wrote the code in pseudo code rather than a particular language.
I hope that helps.
NickE
-
Thanks NickE, I'll try that later. ;) cheers
-
Is there a public beta/alpha release I can try? I'm a cre8or veteran, and I would love to get back to the scene. My best game was Dylan 64.
-
Not at the moment; haven't even programed for a couple weeks (since I was on afternoon shifts and I got my new graphics tablet which took all my time).
However I am back to days and ready to start programing. I'm going to try to get some collision code working, and also work on the GUI system (which then I should be able to make the IDE interface).
By the way, nice to see you around. I still have Dylan 64 on my computer ;)
-
cooldude234,
Whenever I have tried to determine whether a line segment (like an edge) intersects a polygon, I have done it in two steps:
The Line Plane intersection doesn't work.
I tried pluging in the code and it didn't reconize any collisions
-
While collision still rams its code into my brain turning it to mush I decided to take another look at my polygonal distribution algorithm, and the result of 4 hours of programing turned out quite nice I think.
SCREENIES (log in and look down below)
It may have been a bit of brute force but it runs good as far as I can tell.
Basically I generate a percent number (0%-100%)
If it's less than 25 percent I generate the point for 25% of the area (which is between 0.0 - 0.3125)
else if it's less than 50 percent then I generate the point for 50% of the area (0.3125 - 0.625)
and so on
If I were to just generate these numbers from 0 to 1, well because I'm using a triangle there's less space at the lower levels for line V (look at image for illustration) which means I would be generating points closer together at lower levels making them bunch up.
Well anyways the results turned out good and I'm satisfied for now.
-
Did some debugging tests...
I can generate about 10,000 points in about 16 milliseconds
Raxx, you may want to take some notes :P
-
I'm glad someone mentioned Dylan 64, as I was the one who designed the game. How well known is the game within this community?
Before you say I'm a phony and I didn't create the game, I am indeed Segastar21 / Nintendogamr123. My name is Dylan Heisner, I was born in October 29th 1993.
-
Cooldude, can you send me your copy of Dylan 64 and tell me how I can get it running on my windows 7 laptop?
-
GRR! I just made a post and it didn't even send. Some how it screwed up and didn't send so here is my attempt at rewriting it. GRRR SO ANGRY!!
ANGEEEEEEEEEERRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR!!!
So the only thing I can suggest if it doesn't work on windows 7 is get virtual box and run windows xp through it.
So lettme just find it...
Oh here it it is V2 *playing it*
Woot 2009!
I still don't understand why the dog keeps saying barf bag.
I don't remember this much animal abuse (I just kicked a cow off a cloud, and then threw it in a pond :P)
Ah that was a fun few minutes.
Oh and just for the record... PHONYYYYY!!!! ;p Nice to see you back Nintendogamr123
Linky Link: http://www.mediafire.com/download/ismkq00ynvdr02s/Dylan64v2.zip (http://www.mediafire.com/download/ismkq00ynvdr02s/Dylan64v2.zip)
-
Oh silly me, I forgot to write the follow up post.. well better late then never.
OKAY, time for a news broadcast.
What I have been doing on this project recently
Absolutely nothing.
Reasons why I have been doing absolutely nothing on this project recently
Well I just finished building my new machine for the most part (I'll have a different post containing details on that), and I have spent a lot of money, time, and effort into it; and the change over (software wise) was a bit more of a hassle than I wanted it to be (looks like windows xp is really nearing it's final days as driver support dies out <- the only reason why xp is dieing). Also work (that I am so glad I finally have) has been temporarily arse backwards due to some very Canadian weather and has screwed with my sleep scheduled. But with that change now mostly over and work getting back to normal, I have reset up my programing environment and am ready to get back on track with this project.
So what now?
Well I am going to focus on what I know I CAN DO and do that first. Since the dang ray collisions still aren't working I am going to work around them until I get them working (I think I am cursed when it comes to these rays, they won't collide correctly for my freakin life >:( ). SO this means that I will be working on the scripting engine a lot, and implementing the primitive functionality I have with it.
Basic things such as distance formulas (spherical collision), basic statements (if, and, or),simple formulas and basic modules (obj loader) will be implemented all into one and accessed through the scripts. So the goal is to get something simple, maybe not practical or totally useful but rather something functional out as quickly as possible so the project will have a better stepping stone to work from, and be in a better state than what it is in now.
Really the only two things that need to be worked on to get this basic functionality I am looking for is the script engine itself, and the application to edit the scripts (the second half is less important as you could script using something like notepad, although not practical it WILL WORK, I WILL MAKE IT WORK [PERIOD!]
I am not going to let this project fall or fail or break or blowup, it has gone to far to just leave it at this point and I made a promise (some where along the ways I did) to finish this project(or in other words, make a equivalent to better version than the original). And I will do just that [EMPHASIS ON THE PERIOD!]
Thank you for keeping with this project all the way through (if you have, and if you haven't thank you for trying (and if you haven't tried then, uhh SHAME ON YOU I think?)).
-
The Scripting Language Takes Shape
So made my own tokenizer and parser completely from scratch simply because the functions provided with C++ to do such a task weren't enough for what I need, and all the libraries out there didn't fit what I needed either. Long story short I have made a set of functions to do what I need.
So what does this "tokenizer/parser" do?
Well it can differentiate between spaces, brackets, or any set of characters (and without any bulky extra code!) and understand what it means essentially.
So when the parser runs a script it will check for any delimiters (such as commas brackets end-lines etc.) by reading character by character, and once found it can do a certain task. For Example the first line in the example script below says Use_double_buffer; the semi-colon on the end means the end of the line. So when the parser reads each character and finds a semi-colon it runs the function that it read from the start to the semi-colon.
To put it the simplest, it reads much like us humans do, but much more technical and "computery".
Use_double_buffer;
New Texture CharTexture;
New Model CharModel;
CharTexture = LoadTexture ("testTextu.bmp");
CharMode = LoadTModel ("testModel.obj");
Main_Loop
{
SomethingFunction;
UseTexture (CharTexture);
DrawModel (CharModel);
UpdateScreen;
CheckEndCondition;
}
As you can see from the test script above that I have been working from, you will be able to do things such as control loops and more. However incorporating this into the editor will be interesting. Because the original cre8or had drag and drop functions which a lot of people enjoyed using (like myself) as it was really easy to get into as a beginner. But it'll be one step at a time I take.
ERROR HANDLING
Basically if you have an error within the script the engine will still run so as long as the engine didn't receive an error (like a bad memory allocation for reading and writing from the ram). Meaning if you have an error the parser will know about it but continue. However I can make it stop the script, but I'm going to be making a function to let the user decided what to do. It will be simple as this GetError(ErrorHoldingVariable); which all would do is a hold a value which represents which error case it was.
EG error case 1 would equal bad syntax (in other words you spelt something wrong), or error case 2 could mean missing parameter or even missing texture (like the file is missing or something).
If it was done that way then the user could script a function that could make a pop up saying error, or have a function that would work around the error and let the code continue.
Anyways I gots to gets to beds, I have less than 5 hours of sleep for work tomorrow :S
Anyways, Happy late family day everyone!
-
I decided to do some test on my new tokenizer which cleans up the code a bunch.
So I compared my function to the C function for tokenizing (which I was using before) and I loaded up the config I had made (which is about 10 lines long) and tokenized every line. I did this for 100,000 times and measured the time it took for both functions to do this.
So 100,000 files being loaded up (10 lines each) and tokenized takes 3.218 seconds to do using my function. Whereas the C function takes 0.891 seconds to do the same. Now to be fair my function is a bit more flexible, and makes the code look neater; but this is no excuse for having slow code. So there is optimizations that need to be made, but to be honest this is the first time I have no clue how to optimize a function that I made in C++... THE FIRST TIME.
So it feels a little strange that for the first time I have no clue how to optimize something (as I been working on C++ for about 3-4 years now), but it's not like the function is ridiculous slow so I won't bother with optimizing it right now, getting functionality working is my priority.
A little extra insight, I will be adding a script function to give access to the tokenizer so writing and reading files can be more useful to the user. I will also be making a separate function to handle tokenizing for the scripts a bit better, and that may be accessible as well, but we'll see about that when the time comes.
-
So a little update to the scripts.
I got basic variable functionality working; you can now define and use variables as such...
New_Texture Mytexture;
Mytexture = LoadTexture Textures/blahblah.png
Note: I still have yet to implement more operators than the simple equivalent symbol but I plan on making a better way to handle such things so when I do, I will make sure to add the rest.
As of right now I truly only have the texture variables working, but I have the structure ready to implement integers and more. How it works on the engine side (variables that is) is I have a predefined variable structure that holds all the variables defined in the script. And when something is defined in the script, it is added onto that predefined one in the engine; meaning only what you define is actually whats in the ram (besides the engines dependencies). So the engine and scripts could only use a couple MB of ram, or you could soar wide into the Gigs if you so wished (although 32 applications are limited by 2 gigs of ram by default, but I will be compiling a 64 bit version which will be fully compatible with all the same scripts).
So far making a parser and scripting language, tokenizer etc. all from scratch is proving to be easier than checking if a line intersects a triangle.... I'm not sure if that's a good thing or not.
-
A little off topic but I'm finally moving from xp (well for my main machine at least). Good bye good friend, it's been a good 11 years or so, but I will always see you on my laptop. Now once 7 is installed I will put on the windows 7 xp theme ;)
Now back to topic I forgot to mention that using my tokenizer function, you can parse a line from a file that is longer than 256 characters (which is how I had it set up before). Now you can pretty much parse a line that is in any size (so as long it fits in your computers memory).
Also for the first release I'm going to use Audiere simply because port-audio is taking a lot longer to figure out how to use than expected.
Another thing to mention is that even though the engine and the editor are two completely separate things I will be releasing them both under the same versions (EG V0.5 of the editor will use V0.5 of the engine) but if any fixes or small revisions are made to either or then there will be a sub version to that version which will be specific to it's self (EG V0.5.1 of the editor could use V0.5 of the engine, visa-verse).
Now I'm obviously not very good at estimating time with this project, but I think I will have the first release finished before the beginning of summer! WOOT! (it's just the script engine I got to get finished!)
-
Ocuclus rift integration was going smoothly until facebook decided to buy out the oculus rift.
Now I'm unsure if I want to add it to the engine or not, I feel like facebook would then start stealing my identity or something, or change the licensing to something horrible :S
*BLEEP* facebook!
-
NOTE: Boring stuff in Red.
NOTE: FUN stuff in Green.
I HAVE PUT THE ENGINE ON HOLD
well sort of...
I decided that instead of shipping the first release to the public in mid to late June I would use the engine in a game for a friendly Just-for-fun competition (similar to the ones on this forum but for you know... games and programing stuff) and hold off the release for a couple months. I decided to do this because competitions usually are good way to get productivity going and results in a good learning of stuff (and apparently bad grammar too! XD).
More to benefit from this, using the engine for an actual game can not only show its flaws ahead of time, but also show it's strengths. Meaning I can make things a lot more functional and intuitive towards the goal of having a flexible engine that is both easy to use and learn and not limiting to any means.
This has also proven to be a good choice considering in the last week of constant programing for this competition I had finally gotten portaudio (the sound library I tried to use before) to work. MEANING THE ENGINE NOW HAS SOUND WOOT! Also meaning full surround sound support will be soon available.
Using portaudio brings many benefits, mainly the one that I (the programmer) has full control over the sound processing (portaudio only manages the sound devices, you deal with all the sound data your self). So if I wanted to make a function that adds an echo effect to the sound than I can (and I probably will); and once I figure out the best way to go about this I will probably add some way for the user to have full control over the sound besides a few VERY TECHNICAL stuff, which mostly has to do with buffers. Which is unfortunately the downside to portaudio, it leaves me to do EVERYTHING myself (but I don't care, it's just that making my own Ring buffer and constant read write functions with a sound manager is going to be a pain in my bum cheek).
So about the game competition, I will be posting anything new the engine, or anything engine related here as I progress through that and I will be posting anything about the game on the other forum (once I have it up over there which will probably be in a week or two). I will post a link to it when it's available.
NOTE: I got bored with the COLOURS!!!
-
Alrighty again not very much exciting stuff to tell, but no matter (maybe ???)
I have been working on the sound and I now have the engine set up so it chooses the lowest latency possible on a system. This is important because I, (and probably) the user and player don't want to have a 2 second delay between when the sound is processed and when it is actually heard.
Also I was able to make a function (using libsndfile) to simply load pretty much any audio file like so...
SoundVar = LoadSound ("filename");
I will probably make a wrapper for this first thing when I get back to working on the scripting language. I am hoping in the end that I will have simple functions like PlaySound (SoundVar); more on that below.
Right now I am trying to implement a FIFO ring buffer for the audio stream so it can have data being read and updated in such a way that makes it consistent (more importantly no artifacts in the sound!), however this has brought up a whole new world of issues regrading memory data sharing over multiple threads :S amongst other problems like locking (I can't have one thread hold up another just because it's running temporarily slower).
And I figure to solve a portion of these problems I'll have to work on a sound manager for the main thread. Something that handles all the sound data until the audio thread can handle it. For instance if the sound you were playing was a music track that was minutes long you wouldn't be able to fit all of that data into the buffer (which can only hold about 100 milliseconds worth right now, and that is HUGE for an audio buffer as is). So what needs to be done is store the unplayed data on the main thread temporary on a copy sending small bits at a time when the buffer is "freed" up (but I don't want to constantly create and destroy variables).
Having one copy of each sound on RAM would be most preferred but I am having troubles coming up with a way to store 'copies' of it (maybe virtual copies or simple variables like copies = 5; and other stuff related like the position in each sound copy).
The latter is probably what will be best suited but still leaves many issues to be solved.
When I call PlaySound(file); I what I want is the sound manager to take play that until it finishes, meaning you only have to call the play function once. The sound manager will have to remember what is called to it, what is left to play of each sound, and to free up the memory when it's done.
Effect's (like a simple echo) will be calculated when the sound manager processes the audio into the buffer on the main thread.
okay I think I'm rambling on now, I need sleep anyways I worked 8 1/2 hours then programmed for 6 and I was awake for about 3-4 hours before all that and oh I'm rambling on again.
-
Apparently between work and programming, I got tendinitis. Gah! I have to program with one hand.
Well at least there will be less rambling.
-
So I never really got far on that project (0 game content made :'()
Between my arms feeling like they are going to explode and the state of the engine I just didn't get very far.
HOWEVER because of this project I realized that the engine was the equivalent of a DIY motorbike made from a washing machine and oven stove-top. Meaning I ran into a TON of issues that I wouldn't have noticed other wise.
Most of these issue relate to the structure of the engine and the lack of just very important (and seemingly basic but a lot more complex when you go to code it) stuff.
So the entire time I was working on the engine, which of course isn't a bad thing. But I will continue to work on this project until the deadline is up as it's laying down the ground work, foundation, and structure plus the roof of the engine :P
Simple form of what I have got done
-Better GUI functions
-GUI is now more dynamic (as in you can resize the screen and the GUI will move to fit the screen if you want to, this was working before but wasn't very widget based)
-Better state checks
-ACTUAL states checks of GUI elements (yea that wasn't really a thing until now ::))
-A broken FIFO buffer (which can handle one update every ten or so seconds without blowing up, yea defiantly broken)
-Controller idiot proof (so you cant blowup your program by ripping out the controller during running)
-Reimplemented Particles and sort-of improved their structure to be more reusable and less memory wasteful
-Fixed a position problem in the fonts then rebroke (<-not an actual word) it (word wrapping).
-realized I was stupid and never added in a dead-zone threshold for joysticks (realized this when I got another joystick which is a lot less accurate near the center position) so I added it to the config file to be changed by the end user without having to run the application
-Still haven't solved the collision problem, but did figure out a nicer way to implement it into the rest of the structure.
-and of course the overall structure has been improved to keep the main loop as clean and smooth as possible while retaining the no bugs guarantee sticker I intend on giving it.
simple form of what I realized I need to do, or do better.
-Better widget structure for GUI
-Text functions needs to be converted to just functions and global variables, no point in having a dedicated class and wasting the extra byte ;p
-Text needs to be both AA AND compatible on all platforms (probably multiple rendering modes for text will be the answer for better performance vs compatibility)
-Resource Manager, so you can't accidentally load up more than one copy of a file
-A sorting function for the render functions
-Better rendering structure to support a sorting function
-Clean up OpenGL specific functions to be able to wait less on receiving info from the graphics card
-Make an interpolation or average of the frame rate to remove stuttering that can occur at random times when the OS does stuff in the background
-EVEN BETTER code structure, what I got is just the beginning
And a ton more stuff that doesn't matter as much right now.
-
OH the JOYS of programing...
...So for about a few months now I have been trying to re-implement shaders. However I kept running into some issues; opengl kept sending me the error flag "invalid operation" whenever I tried to use my shader. I had no clue what was causing this to happen, everything seemed to be perfectly fine. However today after a few hours of programing I realized that my main function for the shader, or more specifically the function type (void) was written with a capital as so Void. It's supposed to be void, not Void.
That's about 3 months, THREE WHOLE MONTHS all because of ONE capital.
Oh, the joys of programing.
stupid capital v
-
ouch - deepest commiserations, cooldude!
-
yea it just happened again :P
this time it was only 2 hours and it was a semi colon (end line)
I just remembered that glsl code needs to have end lines just like c.
No wonder why it kept sending me errors ::)
-
A quick look at what Graphics Library Shading Language (GLSL) is.
Basically it's a bunch of code that runs on the graphics card and overrides how things are drawn on screen :P
I know, I know, I'm the greatest teacher in the world. No need for an applause ::)
There are two main important parts to GLSL that one needs to know, Vertex shaders, and Fragment shaders
(there's also geometery shaders for more specific gemeotry stuff, but not bothering with those yet).
-Vertex shaders is what handles the points that make up the geometry.
-Fragment shaders is what handles the individiual pixels that are drawn between the vertices that make up the polygons.
Now with that out of the way...
So I decided on how GLSL will be implemented.
I'm going to make it so that the user can write using GLSL code directly (so that way using any GLSL code from the internet or other sources will work pretty much all the same) with the added benefit of my scripting language tied right in.
Hopefully this way I can make some functions for shaders specifically in so that it can make it easier to program.
For example, a normal vertex shader in GLSL would look like this.
void main(void)
{
gl_Position = gl_Vertex * gl_ModelViewProjectionMatrix;
}
How GLSL shaders could look with functions from my engine.
void main()
{
Pos = VertexPos;
}
Simply I would just parse through the shader when loading it and when I come across one of my functions I would then change it around so that GLSL could read it like normal.
So Pos = VertexPos; would then be changed to gl_Position = gl_Vertex * gl_ModelViewProjectionMatrix; making it easier to read and write if your not used to such stuff. But even better this then allows me to follow the same naming convention style as the rest of the scripting language. And as well I'm going to allow the full standard GLSL functionality so if you want to handle it that way you can!
-
Oh yea, and this is what happens when you accidentally multiply one variable in a shader :P
-
And some long awaited (I hope :P) screen shots.
Basically just showing off some really simple stuff you can do with shaders.
More importantly there is now a much much better contrast and brightness control instead of the old method I had which used a rather brute force workaround method using blending functions with quads being render to the scene in front of the camera.
EDIT: Apparently this was my 700th post, didn't realize I had made that many lol
-
Alrighty, I haven't been able to give much of an update as I have been taking a lot of time to make the code much better and doing stuff that you can't so visually see, such as variable creation on the fly!
Yes that's right, you can now script in variables; and considering that scripts aren't compiled they're just read in real-time by the parser that technically means you can define variables whenever! This gave me an idea of having a script editor that you can edit while running your application (however that is just an idea, nothing said in stone about that). So far you can define a integer! WOO! but the ground is there for others.
Now because Steve decided to add shaders to anim8ors preview render (the opengl workspace) I decided to get on my lazy butt and program in some lights! So now we have screenies to share. Yup that means there are now technically shaded lights (mostly just ground work again :P)
EDIT: 3rd image has some bad normals in it, that's due to my obj loader or anim8ors exporter, I still haven't found the issue of it (not like I looked very well into it :P) but the image shows a good amount of detail the lighting can do.
-
Real-time audio now works (even though you can't play an audio clip longer than the buffer as it gets cut off).
Nuff said :P
-
Ahhh cooldude, this has been one of the coolest dev processes to watch, ever. To see that you're still working hard on it is just inspiring!
-
Yea keeping at it is one of the hardest things to do; just as hard if not harder than actually doing said thing (especially when switching jobs and shifts while managing everything else in life and still having enough time to sleep ;P).
P.S. Most of the work I did on this project for that past half a year has been engine structure, look forward to it in the next post.
-
The engine is divided up into sections which are designed to enable you to do specific things, or to handle specific things for you (so you don't have to go through my pain right now :P).
These include:
Audio
-loading and saving
-low latency audio playback (with control over sample rates and buffer sizes)
-Audio manager (which manages long sections of audio to continuously feed
the buffer till that audio is finished)
Rendering
-Primitives
-models (loading and saving, the latter will be implemented later)
-Shading
-lighting
-specific drawing algorithms
-tessellation
-generation functions (eg. random point on triangle function)
-etc
Scripts
-Variable handling (<- realtime creation and destruction, array support will
come later)
-Control handling (loops and functions/sub scripts)
-Wrapping
General functions
-Math stuff
-other simple functions (such as conversions between variable types like string to int and more!)
The scripts will be able to wrap a bunch of functions in the engine to give support for a wider range of functionality; as well the scripts will be able to wrap a lot of C functions directly so that way the user (the one scripting the engine) can access to a lot of functions post compilation and in realtime (in other words the engine reads the scripts version of that function in realtime and calls the compiled version of said function).
You can get a sense for scripting by comparing it to a car.
When you drive a car you are only physically moving the steering wheel and pedals. You don't directly move the pistons and wheels but yet you still have control over where and how fast the car goes. Scripting is like the steering wheel and pedals, much easier to move and steer your car; but you may not have full control over how efficient your engine runs or the max speed of at which it can be. Programing and compiling code is much like the engine and the rest of the car.
The following images illustrate the architecture (more so in this state -> the basic structure) of each section (excluding rendering because at the moment there isn't too much going on there other than some generic opengl calls and some functions I have made, I will be making an rendering manager thingy at some point).
-
took a break from memory management stuff to try and fix the normals.
I am 99 percent sure my obj loader needs to be fixed and for sure optimized so I might just go ahead and implement the parser for the anim8or files.
But during that I worked out multiple lights and added attenuation to them.
So yea any excuse for a screenshot :P
-
Having some fun with glsl making a cheap volumetric fog.
*sigh* I should get back to the real work now.
Edit: that last one I was just srewing around with values and got that :P
-
Is this a game engine?
-
Simple answer, Yes!
I assume you are not aware of the original cre8or.
It was an application that utilized the kjx engine and anim8or to make games. But since it's unfortunate end I have decided to restart the project using my own engine and programing everything from scratch.
I kinda hijacked these forums as it still is anim8or related-ish (as it does utilize anim8or)and I do not have anywhere else to post at the moment (am getting a site, but having troubles setting up forum stuff).
And as you can tell by the last few post I am currently working on GLSL support and trying to work out some bugs with that (things like max uniform arrays, gah those stupid max uniform limits are really getting to me ):< ).
-
How does it use Anim8or? By importing .an8 files, or are there bindings of some kind?
-
The Original cre8or loaded the an8 format and used model and figure data which had scripts tied to them. It also used scene data to place said objects and figures in the initial scene for the engine.
How I plan on implementing the an8 file format is similar. I wont be directly tying scripts to the models (as it makes for reuse of models a real big pain). The scripts however will be able to call the engine to render any model loaded up from the an8 file. So a single script could render multiple models. Or you could have a script not render any model or object. This is a big contrast to what it was back in the old cre8or which you had to have a model or object in the scene for that particular script for that model to work.
Also I will possibly use anim8or scenes for something similar to a level editor In which it generates code based on the scene. EG you place a terrain model and a house model at different locations. Cre8or would then interpret this and insert code for those locations and when to draw them.
Although how I implement scenes will be heavily dependent on how the rest of the engine structure turns out.
I do plan on having functions that go around the other way instead of the engine reading stuff from anim8or, the engine will be able to output anim8or files that could then be read back into anim8or.
The original cre8or had something like this in which you could record the physics of your game and it would that segment as an anim8or scene (animating the things that were affected by the physics in game).
One thing I do plan on doing is having skeletal animation and physics that could be recorded and sent back to anim8or (like ragdolls).
-
Added some more features to the scripts, and currently trying to figure out how to implement blocks and scope blocks into them.
Now this wouldn't be such a big issue if this were code that was going to be compiled. Because then I could design a compiler that would organize the code in such a way that would it would work just like normal machine code (removing blocks, replacing them with jumps, not using symbolic names for variables etc). But I have to do all this with stacks and ASCII identifiers for functions and parse it all in real time.
:-\
However I am implementing a preparer optimizer that will try to optimize the scripts to make it faster to read for the real time parser I could then at that point fix a lot of the difficult stuff but it wouldn't solve everything.
I'll post more once I refine what I have written down on scrap paper.
Hopefully this won't take too long to get done.
-
Added some more features to the scripts, and currently trying to figure out how to implement blocks and scope blocks into them.
What kind of scripting language is this? And why do you have to parse it continuously instead of once?
-
It's the scripting language I am making from the ground up based on c style syntax that utilizes the engine
(currently it doesn't have a name so I just refer it to as scripts).
This is the way I am making it so people can develop things with the engine without having the complexity of a compiler.
The reason why I need to continuously read from these is because the main loop will be handled through these; as well as other loops that a person could add if they so desired (eg A for loop).
Basically the engine has a parser which just reads the scripts top down, and certain control structures can influence and tell the parser how to read from these scripts like for example loops and if statements.
Also you can have multiple scripts and call the engine through one script to read from another.
So if you load another script through the main script....
New Script testscript = load_script(filelocation);
Then call it to run....
runs_script(testscript);
The parser will read from testscript top down until it reaches the end of said script.
From there it will continue reading from the previous script at the next line.
Please note that the syntax of these functions aren't 100% official yet, even after the initial public release it may change (a lot of things will when I get feedback, but they will change for the better (I hope ;p )).
P.S. Are you familiar with programming at all?
-
I see, thanks. Have you considered embedding something like Lua and decided against it?
Are you familiar with programming at all?
I've done some Python for Blender (https://sourceforge.net/projects/blenderbitsbobs/) and Erlang for Wings (https://sourceforge.net/projects/wingsthings/).
-
I have considered using lua and even pearl but I wanted more control over the implementation on these as well as the syntax. Also by making my own scripting language and I make the C++ coding structure much similar to the rest of the engine, which in the long run is a much nicer thing.
And wow I haven't heard of anyone using Erlang for a long while :P
-
Been focusing heavily on the sound part of the engine the past week and I finally got a high quality sample rate conversion working on the fly.
I'm having it set up by default to re-sample any sounds loaded into the engine to be the same with what the system is playing back audio on.
Because if you run audio that was recorded at 96000 samples per second and you try playing it back at the more standard 44100 it will sound very deep and low tone; and when you do the opposite, playing audio from a low sample rate (like 22050) to a higher sample rate it would sound high pitched and be played back very fast (like the chipmunks).
So this is where re-sampling comes in handy. If you are running your audio device at a higher or lower sample-rate the engine would re-sample the audio to match the correct sample-rate to make sure things sound correct. This pretty much involves going through every single audio sample there is and finding where the new sample would lie (time wise) one the original and interpolating between the original samples to get the new one. Right now I just have a linear interpolation implemented for this job but I will hopefully add support for other forms of interpolation (for even more high quality).
I posted a screenshot with some debug info on it to help illustrate how efficient this is for on the fly conversion.
Heldon's song, Perspective II is about a 3 min song but has 48000 samples per-second with a total of 9387520 samples.
Converting all that to 44100 to about 0.639272 seconds. Considering this really only needs to happen once per audio file and there wouldn't be that many long audio files being loaded up at once I am extremely happy with the result; and if you look at the result for chime3, a much smaller audio file (about 10 seconds long at 96000 samples a second), you can see how feasible this would be for many small files.
Right now I have it setup like this, Sound = LoadSound (filename); PlaySound (Sound); And the engine takes care of the rest.
In the end I'm going to aim for having the user just load a sound and play it and it would work by default and then giving them the option to do all this manually for more advanced uses.
-
[/youtube]
Ps, I haven't gone to sleep yet.
-
Awesome, Cre8oristhe/Cre8orExpert here, are you using Forward rendering for the lighting? Happy to see this much of progress, i'm also working on my engine, from zero once again, this time without fixed pipeline (only GLSL).
-
Right now forward rendering all done in an uber-shader. I plan on implementing various forms of lighting for different use cases.
-
I love watching this project grow, Cre8or! Funny when I go back and see I was the first reply to the topic 4 years ago, and not only are you still hard at work but the progress is evident. I'm staying in this loop for sure!
-
Well I am in the progress of making a video explaining the current progress of the engine and I am hoping to get that out this week sometime before the new year.
In the mean time however I have decided to make a smallish post somewhat directed at Raxx here (hint hint);p
So while I was on holiday time I took another look at random point generation on pollygons (once again specifically a 3D triangle) this time being successful. At first I was trying to generate a value for one side of the triangle and get a horizontal line for this by getting the same distance from vertex A at the adjacent line and then generating a random value between those points. I realized this was wrong for it favoured vertex A and gave a higher probability to generate more points near it (because vertex A had less space near it between the two edges it was connected to).
(http://www.anim8or.com/smf/index.php?action=dlattach;topic=4041.0;attach=11325;image)
I also named the two lines I was generating values for U and V which is wrong in the Barycentric sense (since Barycentric coordinates is all about balanced raitos of mass). At this point (and after many different rough sketches) I decided to take another look at the barycentric system and found the formula for the barycentric collision detection. I took a look at it and decided to do it in reverse (instead of trying to find U and V in the formula I substituted for U and V with a random value).
This is the formula (Where A B C is the vertices of the triangle, and U and V is the coordinates)
A + U * (C - A) + V * (B - A)
So I substituted for U and V with a random value between 0 and 1 (as a floating point). But doing so results in a square of random points. This is because when the sum of U and V are greater than one, the point the formula makes will be outside of the triangle (if the numbers are below zero they will be as well but in the opposite direction). Once again I set out to solve this and it took me a while, with some attempts favouring A B or C (or all but the center) before I realized the simplest solution.
I simply have an if statement to check whether the sum of U and V is greater than one. If it is then I just flip the values from one by taking a value of 1 and subtracting both the UV coordinates (individually) moving the points outside of the triangle back onto it and evenly without any favouring.
In pseudo code it looks like this
U = random_value_between (0,1)
V = random_value_between (0,1)
if (U+V > 1.0)
{
U = 1 - U
V = 1 - V
}
GeneratedPoint = A + U * (C - A) + V * (B - A)
So if you want to use this for your phur scripts raxx go head its ridiculous fast.
I can generate 1,000,000 points along a single triangle in about 0.249605 seconds
and 1,000 in 0.000247805 seconds on a i7-4770k processor.
EDIT: Image uploading works again, thank-you Steve!
-
Excellent formula, cooldude234.
-
Big Annoucement!
So its been a long time since I started working on this project and at some point I realized in order to finish it I'd need to spend more time working on it, which means I would need actual funding. If time equals money then I should have had enough to put a large down payment on a house by now. So I thought about a couple ways to go about this, one being a donation button, but I quickly scraped this idea because I knew it wouldn't bring in too much of anything as well as it being inconsistent.
So with a lot of careful planning and thinking things over I decided to make this into a paid for software.
Pre-Order Now (http://Pre-Order Now)
*links will be available tomorrow (6 PM UTC-05:00)
As of tomorrow you will be able to pre-order the software (once the site is officially up), the licenses are as follows.
Non-commercial use;
- Windows version
$150 CAD
Buy Now (http://Buy Now) - Mac version
$200 CAD
Buy Now (http://Buy Now) - Combo (Windows + Mac)
$400 CAD
Buy Now (http://Buy Now)
Commercial use;
- Windows version
$800 CAD
Buy Now (http://Buy Now) - Mac version
$850 CAD
Buy Now (http://Buy Now) - Combo (Windows + Mac)
$1700 CAD
Buy Now (http://Buy Now)
And if you per-order any of the licenses you will receive 3 free tools/modules valued at $300 CAD that work specifically with this engine.
*more info will be available about these modules in the update tomorrow
Please note that due to compatibility problems that Linux distributions will not be supported and an extra cost will be added to the Mac versions to cover the cost of extra work that is need for that platform.
Pre-Order Now (http://Pre-Order Now)
*links will be available tomorrow (6 PM UTC-05:00)
-
Cool. Do I get fries with the combo? And can I swap the drink with a milkshake? ;)
-
Cool. Do I get fries with the combo? And can I swap the drink with a milkshake? ;)
It will cost ya extra ;)
(Im glad at least someone got it)
-
To make up for the cruel joke, here are some more light-hearted jokes.
(http://www.mediafire.com/convkey/4956/1hldd8iyg0ixxpyzg.jpg)
(http://www.mediafire.com/convkey/8e11/hqqg4rzpvdo9459zg.jpg)
(http://www.mediafire.com/convkey/f964/7uol28np2n1h2ahzg.jpg)
-
Any real news on this project? (Besides the cruel April Fool's Joke)
I would like to know when a download will be available for this. Thank god that was an April Fool's Joke, because I seriously believed that the new Cre8or would be a paid for product with ridiculous pricing. That wouldn't help anybody... (especially me)
-
Yes actually.
Basic collision detection works now (ray triangle collision) and the GUI has been somewhat reworked as well (added layers however multiple screens with GUI's still need work). There's also been numerous of other things worked on from small things like spec mapping and multi texturing to bigger things like normal mapping and a model-texture compression LOD method thingy, that I obviously don't have a name for, that sounds overly complicated but it is only somewhat over complicated :P .
The big thing that needs to be re-implemented is scripts, once I get that working and implemented that's when the first public release will be available (mostly for debug and feedback reasons though).
Now I just need time, I worked several 12 hour shifts in a row at work this week so for the past 7 days or so my life has been sleep work sleep work sleep work and nothing but, and I probably still have a few more to go.
(also an update video is planned still, but I am also looking for a hardware encoder to screen cap without software, as well as Im probably going to move away from adobe premiere to Sony Vegas because premiere is a nightmare to work with)
-
Also a side note, the first public release wont have a gui interface to work from (the scripting application and not the engine) because I need to get scripts fully working before I can start work on that portion. Once scripts are working the engine is fully usable anyways and I'd just prefer to get it out as soon as possible rather than waiting longer.
Basically it just means that with the first public release you will just have to type all of the scripts out by hand (which is probably what you will be doing in the final version anyways) in something like notepad. It's really not all that bad, just a little inconvenient is all.
-
Working on something ya'll might like ;)
-
Okay, well Unicode is working perfectly fine now. Once font rendering is redone, you will be able to have any character from any language available to use at any point in realtime.
I'm just not too sure how non us standards will far with certain things (though in theory they will still be able to type native characters in correctly).
-
RE*RE*RE*RE-fixed matrix functions
Now using 100% of my matrices without any errors or problems.
This allows me to use GLSL 4.5 or really any version of it now (and will make Vulkan actually do something now :P).
-
Ive been coming back to this comment thread about once every 6 months for **years**
Any updates? -
At this point i'm just morbidly curious!
-
I'm going through hell at the moment. Be back when I finish strangling satan.
-
yes, indeed, cre8or looks coOL...I downloaded it. Seems to be operating.
now I need to learn how to use it. ::)
If anyone has any reference material, do let me know.
or if there is an alternative I should consider.
-
yes, indeed, cre8or looks coOL...I downloaded it. Seems to be operating.
now I need to learn how to use it. ::)
If anyone has any reference material, do let me know.
or if there is an alternative I should consider.
Woop, cre8or working on your computer ???
What's your system spec? Cre8or version?
-
windows 7
Help button shows:
Cre8or 0.1.2b
2008