You are not logged in.
the thing is, this is ray traced and is a slow process, wheras looking at the topo thing, it needs to be in real time, so no ray tracing
mikau wrote:You know replacing the F-word with feet might be funny.
What the feet! How did you think of that feeting idea?
i can remember in worms armageddon (a game) if you had the swear filter on, then the f-word would be changed to 'love' when i reinstalled i forgot to disable it, and i was becoming quite confused
whenevr anyone would say f*** you, i would keep seeing love you, and i was getting a bit disturbed (in the context it was being used)
I think some software even adopts a flexible approach, by letting the user configure how much memory to allow for temporary storage.
yes i was just thinking about that. although i dont know if i would have a memory usage limit
rather, i would have different options for the primitaves, like for the heightmap for example, an option to say if calculated data that is reused, can be stored in memory, or should be recalculated.
anyways, my aim at the moment with the terrain is to be able to get my texturing method tested out on it, and then encapsulate it all, so i can add shadow rays and then test it with a water quad using normal mapped ripples reflecting the terrain and then possibly have it refracting water into it aswell if i feel like it
but i might leave that till later since i still havnt got a proper method of refracting between surfaces yet
I wonder if you could make it look like forested mountains?
well actually you could, you could either do it cheating, or realastic
obviously if the rendering is from close quarters, you would actually need to have a model of different trees copied around, which would be quite a slow rendering with all the triangles (or using primitaves, you could make it out of cones and cylinders and some polygons for leaves)
but if it was from far away, like a massive lake rendering, and you have trees on the far side, you could just edit the heightmap to the shape of the top of the trees, and edit the texture
one thing i need to learn, is the 3dsmax file format for its exported models so that i can have them loaded into the ray tracer
-------------------
ive made another two renderings, again with grass, with sand of a different terrain
ive know finished and tested out my algorithm for intersecting a ray with a heightmapped terrain
(check image, heightmap and texture shown at top, the rendering is blurred slightly to make it look nicer)
i havnt tested with shadow rays, so its a little bit difficult to properly pick out the shape of the terrain
. anyways
in the rendering the heightmap is 512*512
and instead of intersecting with 522242 (2*511*511) triangles, which would be INCREDIBLY slow, i use an algorithm that does this
first it finds the first intersection with the bounding cuboid, (if the ray origin is inside, that is used)
and then it finds the first intersection with the grid (by checking the next vertical,horizontal line and getting the closest)
from there it finds the amount needed to get to the next vertical and horizontal intersection, but instead of just going through the horizontals, through the verticals, it just always moves to the next nearest grid intersection
with the two intersections (or not intersections) it checks the two triangles underneath for an intersection using a ray plane intersection, and then checking the intersections coordinates to determine if its on the triangles projection.
the normals for the triangles are calculated in realtime, but the normals used for shading are precalculated in a normal map storing the average vertex normals which i made another tool for in my ray tracing package to be. from the intersection, it gets the 4 surrounding vertex normals, and then interpolates to the intersection given a smooth shading
im now going to try and package it into a function, and then add shadow rays.
the current texturing is just a single tiled texturing, but ive also developed another method where you would have an image like the second one below, where the two regions of each r,g,b channels corresponds to a percentage of one of six textures which are combined at the point which can be VERY useful, since you can just draw a colour map like the one below, quickly edited, and then you can just change the textures, and their tiling on the fly without editing the colour map, and like this you can get quality texturing with a map the same size as the heightmap, whereas having a complex single texture, youd need to have one atleast 10x bigger to get quality texturing, but thats for later
do you think i should also make it so that you can use another special normal map (which would be twice the size of the heightmap) to store the normal triangle normals for intersections? (i.e. increase rendering speed, but with a file size gain, which is the same for this other special normal map im using, which im going to have as optional)
------------
edit:
i rendered another one, same camera angle and everything using a sand texture, now you can really see the shape of the terrain, even without shadowing
321. If loga+logb=log(a+b), express b in terms of a
322. If log(x+1)+log(x-1)=log3, what is x equal to?
323. If log8/log2=x, what is x equal to?
328. In ΔPQR, side QR=10 cm, height PM=4.4 cm and side PR = 11 cm. What is the length of altitude QN?
whats M ?
329. The area of a square with side x is equal to the area of a triangle with base x. What is the altitude of the triangle?
divide by xWhat is the altitude of an equilateral triangle of side 2√3 cm?
generally you would write
asThat is really Beautiful!
Could you use "Image Upload" to post these on the forum? In a year or so the imageshack images might be gone.
done and done, ive rewritten the first post, using the uploaded images.
physics uses alot of complex math, especcialy when moving into advanced theory and concepts
and programmers always need a certain amount of math and logic skills
if you go into graphical programming, then you need alot of math knowledge
logistics i guess uses alot of complex math, like finding trajectories of a rocket leaving earths surface on route to mars and math like that
Lots of work I bet to create that program.
How many kilobytes large is the source code you wrote?
What is this pink thing at
http://img409.imageshack.us/img409/1148/ehm0ut.jpg ??
I can see its shape applied onto the other 3-D objects if I flip back and forth.
Very interesting.
Actually, this is a very messy program i quickly put together just to test the torus rendering, the source code is 10kb for the main cpp without about another 10kb of my own code for files containing a Matrix class, a vector class, and classes i made for loading bitmaps and for solving quartic equations.
the pink image is the texture im applying to the surface, i just used smudge tool in photoshop and added noise
Ive finnaly got my ray-torus intersections working, and ive made a quick and messy sample program testing it all
there are two renderings of tori in the images, one shows a traditional style torus, except that it is stretched by a factor of 1.11 in z direction and 2.5 in y direction. The othere is what you get when the tube radius is more than the ring radius, and again is scaled.
I have also tested out texturing the tori, and applying a tangent space normal map, which requires finding the tangent vectors at a given point on the tori.
You can see the texture, the pink thingy at the bottom, along with the normal map im using
(is it just me or does the non-traditional looking torus look kind of like an apple (ignoring texture and normal maps))
I understand the principle of the binary root finder, but the flash animation doesn't make sense to me.
The torus looks great - excited to see it with shading.
I am a user of POV-Ray, but many times I find myself going through the "change a value, see the result" loop (you know: 1.2? no. 1.3? no. 1.4? no.) trying to get it right, and I really wish I could just click and drag the shape (or the lights).
So, will your ray-tracer allow this?
well, im not so sure about that, via ray tracing, id say deffinately not since it can take depending on the scene seconds or days to render a scene, the only i could see that happening is to have the editing enviroment have a traditional scan line rendered scene aswell that you can edit visually. But thats along way away Although ill deffinately think about it
to the flash application, what its actually doing, is generating the quartic function of a ray-torus intersection, and then just graphing it, finding the roots and displaying them via the blue vertical lines (did you click it to regenerate?)
http://img60.imageshack.us/img60/4500/showsub7da.gif
that is sort of showing what the sub division thingy is doing
it takes the xmin and xmax and finds the y values
it then splits this in two calling the same function with xmin and the mid of xmin and xmax, and then with the mid of xmin and xmax with xmax so that it then calls the function for each half, and then keeps repeating so it then cuts to quarters, then eights, then 16ths, until the number of sub divions has reached the max. Which in the case is 3
so once the number of sub divisions is the desired, in this case 3, it tests the y-coordiantes, and if they are on opposite sides of the x-axis, uses the mid of the two x values as the root, so you can see in the image that in this case, with just 3 sub divisions, the 2 roots on the right are quite accurate, but not the one on the left, if you increased the number of sub divisions, the roots become more and more accurate
infact, i had it so stuck in my head to use a recursion method, that i can probably just make it run faster by just calculating the x-increment needed, and just looping from xmin to xmax, but nevermind
the good thing about this method, is that i can maybe make some culls to the sub divions, like if the y values are very large and on the same side, depending on the current sub division, stop sub dividing for that sector because its very likely there wont be a root or something
http://img353.imageshack.us/my.php?image=testsubdivide7hr.swf
theres something i made to test my recursive root finder
the function takes a min and max for the x values, and the number of sub division to do
from there it will divide the gap between min and max in 2, and then for each half, divide again, then for each quarter, divided again until the number of sub divisions has been met, then once it has, if the y-coordiante of the left and right are on opposite sides of the x-axis the middle of this is taken as the root, its not perfect. but as you can see (this is using 8 sub divisions) it works quite nicely (although for proper accuracy, since these graphs are being scaled by 1/100000000, you need to use +20 sub divisions)
the number of y coordinates found from the quartic equation is 1 + 2^n, n being the number of sub divisions, so here, the number of y coordinates found is 257, which seems quite a lot, but it runs quite fast. Theres always ways i could improve this, like by assuming that if the y coordiantes of each side of the sub division are both massive or both tiny, that there wont be a root inbetween, but that might lead to roots not being found all the time
this is actually finding the roots of a ray-torus intersection aswell so it seems ot be working alltohugh i havnt ported to C++ to test it properly in rendering
----------
http://img114.imageshack.us/img114/7161/testtorus0et.jpg
all be it badly textured with no shading, atleast it has seemingly ray traced correctly, i have also tried where the tube radius is more than the ring radius and you get the sphere with the inward spikes at the poles
well i found one last error in my quartic coeffecients, and ive tested it out by finding a coordinate on the torus via the parametric equations and given a vector and a calculated value for 't' found the value of the quartic, for a point on the torus, the value of the quartic is < 1 * 10^(-4), and i tried increment 't' by a small amount like 0.001 and the value suddenly jumped up to >1*10^6
so it deffinately seems to be correct now
(my mistake was in the t coeffecient, i had 2(av)(2|a|^2+ R^2 - r^2), where it should have been 4(av)(|a|^2+ R^2 - r^2) )
however, i did a bit of looking on the internet, and it seems the general solution for a quartic is very numericaly unstable, which i seem to have found out on my own, so im thinking of other ways to go about solving it, the only way ive seen is a recursive algorithm to find the roots by basicly subdividing a search area between randomely selected values, until a value is found that the quartic is less than a given range
but if someone get find a numericaly stable method of solving a quartic, itd be much appreciated
well although ive never made my own 3d engine in C++ or a similarly powerful language
i have written a few 3d engines in Macromedia Flashes ActionScript (v2) using its drawing API to draw filled polygons
The most advanced one ive made to date, was probably when i first learnt how to clip polygons and i made a fully imersive 3d engine
http://delta.ecwhost.com/sample2.html (this was over a year ago now)
since then ive made a few things using a base engine which ive then modified and optimized to fit the situation (losing dynamicness, but gaining speed which is essential since flash player aint exactly the fastest thing at running its bytecode)
the only thing relating the 3d i have done in c++, is ray tracing of which im currently working on a large rendering package which i rambled on about in a thread i made asking for help with ray-torus intersections
But basicly it will have alot of the functionality programs like pov-ray host, but with a less complicated language (and since im not exactly an expert, probably wont run as fast, and deffinately wont be multi threaded). The simple function based language ive made is also not very complicated, and is a basic function(parameters), then to set a variable object, #s1.function(parameters), and to edit an object from its variable, or to point to an objet variable ~s1.function(paremeters), where ~s1 would be used to refer to the object
I see I'm not the only one who has conversations with himself.
i only usually do when im figuring something out and asking at the same time, and then end up answering myself before anyone responds
to the first post
i believe the falicy he was looking for was not the +/- one, but to do with the square root expansion
its often taught as a law, that sqrt(a/b) = sqrt(a)/sqrt(b)
but this is only true, when b is a positive real number
in the case of -1, this is non positive, the falicy he was looking for is that while sqrt(-1/1) = sqrt(-1)/sqrt(1), the sqrt(1/-1) =/= sqrt(1)/sqrt(-1)
that is because while i/1 = i, 1/i = -i
null and void
i think you will find its "tori" *
i did say tori everywhere else, only on the last part i said toruses
a dot b = cosine of angle between them, cosine of 90 degrees is 0, so if a dot b is 0, they are perpendicular
a dot b = 2*5 + 3*-2 + 1*-4 = 10-6-4 = 0, a,b are perpendicular
a dot c = 2*10 + 3*-13 + 1*19 = 20 - 39 + 19 = 0, a,c are perpendicular
b dot c = 5*10 + -2*-13 + -4*19 = 50 + 26 - 76 = 0, b,c, are perpendicular
ehm, i dont know exactly what you mean by capital, but supposing its the same as profit?
10500 / 7 = 1500
C gets 1500
B gets 3000
A gets 6000
It certainly looks like you are immersed in some heavy coding. Can you tell us more about your ray-tracer?
well, its the third one im building, i started with a very simple one having only reflections, spheres, ellipsoids and planes
then another smaller one that had full camera and transformations for the primitaves
the new one im making is a MASSIVE advancement on it, along with a full GUI im creating for it to encapsulate all its tools
this one will have spheres,planes,cones,tori,cylinders,capsules (all rotateable and scalable) (all with textures, normal mapping, refraction maps, reflection maps (i.e. you can have a sphere with a procedurally generated fractal texture, with the same texture renderered in grey scale for a reflection map so that the white parts will reflect all light, and the black parts reflect no light, with a heightmap converted to a normal map for normal mapping to give it a 3d look, with a refraction map opposite to the reflectoin map so that the black parts on the reflection map would allow all light to pass through and be refractad))
along with a generic quadric and quartic shape primitave, along with procedurally generated Julia quaternion fractals (along with other types) and procedural 3d Perlin noise clouds/solids along with 3d procedural textures)
along with CSG so that you can have a sphere with a torus cut out of it to give a round indent on the sphere) along with convex polygons.
along with 3d heightmap terrain, using another type of texture of colour which holds data for each vertex of the percentages of each 8 textures per heightmap texture to be used at that vertex)
and if i learn it, photon mapping. Also fuzzy reflections (i.e. multiple rays cast out to give appearance of noise at a very low level) which i might use for 'fake' photon mapping to scatter rays of light from a scenario when light would be absorbed to give atleast some sort of real ambient lighting in reverse.
Tori, especcialy from the quartics is very important i feel, since using CSG, you can make mega complex shapes, using spheres, toruses, planes and cylinders.
I have already written in a seperate c++ program, a compiler that takes a scene file, containing a function based language to set up the scene that parses and converts it to a binary .drt file read by the renderer which will save a .bmp of the rendering to the given directory
a pretty BIG project, but its constantly challenging me in ways of maths, programming and algorithmics so its never a bore and since ive started ive pretty much learnt/figured out most of what ive just written above (id already written programs in the past to create fractals and quaternion renderings, but never ray traced or included in a ray tracing package)
this is all alongside my GCSE and A-Level exams (GCSE + A-Level Maths of which im studying 2 years early)
ANYWAYS, in terms of the toruses
rays are cast out from the camera in its system, then transformed and translated to world system, then translated and transformed into the objects base system so that the object is always at the centre, un rotated and un scaled so that the intersections can be found with far less complex math, and then intersection point and normal to surface at the point are un-transformed and un-translated back into world space
i : cos(t)(m+cos(u));
ii : sin(t)(m+sin(u));
iii : sin(u)
for t,u from 0 to 2Pi
what has that got to do with anything ive said, or about the links i posted at all? Did you read anything i said?
i Did say, RAY-torus intersections, not: what are the parametric equations for a torus
by 't' i meant, t from the ray equation a[t] = a[0] + tv, which i explained about the first problem in the first link, i put it onto that webpage, because it was easier for me to right it out in html and put it on my site, than posting it all here since i dont know all the things for the [math] tags to be able to have subscript etc, and you cant have different sized and coloured text here
im trying to add tori into my ray tracer (among other quartic shapes) but atm im just concentrating on tori, but im having troubles in both the quartic equation that has to be solved, and in solving the quartic itself, im using ferraris method as described on wikipedia, but it doesnt seem to work (my complex math is right, im pretty sure of that)
as for the quartic equation itself, ive went through it about 4 times, and i always get to the same set of coeffecients, but when comparing with the expanded torus equation, the values never seem to be exactly the same, even after taking into account round off error from computations
http://delta.ecwhost.com/TORUS.html
http://en.wikipedia.org/wiki/Quartic_equation
and my complex math:
a*b = (a.x*b.x - a.y*b.y) + i(a.x*b.y + a.y*b.x)
let d = |b|^2
a/b = (a.x*b.x + a.y*b.y)/d + i(a.y*b.x - a.x*b.y)/d
arg(a) = atan2(a.y,a.x); // from c/c++ math header
let b = sqrt(sqrt(a.x*a.x + a.y*a.y)); // i.e. |a|^(1/2)
let c = arg(a)/2
sqrt(a) = b.cos(c) + i.b.sin(c)
ln(a) = ln(|a|) + i.arg(a)
let b = e^(a.x)
e^(a) = b.cos(a.y) + i.b.sin(a.y)
a^(1/3) = e^(ln(a)/3)
ok then, how about this false proof
-1/1 = 1/-1
sqrt(-1/1) = sqrt(1/-1)
sqrt(-1)/sqrt(1) = sqrt(1)/sqrt(-1) or..
i/1 = 1/i
i/2 = 1/(2i)
i/2 + 3/(2i) = 1/(2i) + 3/(2i)
i (i/2 + 3/(2i) ) = i ( 1/(2i) + 3/(2i) )
(i^2)/2 = (3i)/2i = i/(2i) + (3i)/(2i)
(-1)/2 + 3/2 = 1/2 + 3/2
-1/2 = 1/2
-1 = 1