TERRAIN
Can anyone show me how to write terrain using CE
I had a full had of hair 3 weeks ago im now bald..and at 14 that is bad.
Im willing to pay for this..well ermmm my parents are
..ive told them i need 500 pounds($700)..and they seem to think that is ok..
so are there any takers
Hello.
If you're
serious about commissioning somebody to write you a terrain engine, you should:
write a much more verbose/"better" specification saying what you want,
exactly ... "write terrain" is a little ambiguous
put a post in the job-offers forum
maybe offer a way of proving that a payment could/would be made to the provider
On the other hand, I gave a link to a terrain paper in the "Assembler" thread, if you want to give that a looking over:
http://forums.pocketmatrix.com/viewtopic.php?t=4063&highlight=terrain
.. but to implement that "properly" is going to take assembly language and skills you *probably* don't know yet (maths, mainly).
I believe that Phantom published a terrain engine demo a while back, but I'm sure he'll get back to you on that one
Cheers, good luck,
Refractor.
obviously id prefer not to pay...
i only want to know how to do this as i have an idea for a game and i will need 3d terrain...ive read all the stuff in opengl and directx and ...i have no problems writing the cod for heightmaps or even just importing a 3d max model.
my problem is that i saw the phantoms voxel engine..and realised that this could be done using easy ce ...but whatever i try i cannot get anything to work.
anyway lots of people have given me links to terrain building faq's etc etc... and now i have so much info on how to this kinda stuff im getting to feel a bit of an expert.
but can i get anything to work on my ipaq...NOOOO!!!
and as i cant find anyone to show me how they have done it..if anyone actually has anyway..then i thought that maybe if i can pay someone then i wll get to know how.
I have told my parents its for eduction..which it is ,so they are willing to pay..but i dont really like misleading them.
so i hope that answers your question
That engine I wrote is a voxel engine. And I sold it.

Can't tell you who bought it.
Anyway, the basic idea of a voxel engine is:
- For each scanline, find the 2D world position. If you would simply plot a texel there, you would get a mario kart view. Start with the bottom scanline (the 'closest' one).
- Instead of simply drawing the texel, you fetch it's color and height (from a height map, same size as the texture).
- Now, draw vertical bars with the height you got from the heightmap. Clip them against the bars you already have drawn.
That's the basic idea. My engine used some more stuff, like fogging, bilerp, animated water, a spherical sky dome, reflections etc., but above stuff is the basis.

hey, well.
1.voxel landscape is fine, but:
a)it's often blocky
b)it's problematic to add objects over it (you either have to use 3d objects or use some bitmaps (forgot the word for it atm.. argh)
another approach is an usual 3d approach, it's harder to start and possible a bit slower, but it often allows for better results in the long run and it's easier to use it with other objects.
If you want I can help you out a bit, unfortunetly I have lost my cable connection and using analog modem only atm, so I mainly read/answer emails. feel free to email me if interested.
PS.check out old PC intros/demos, they often have got such effect and sometimes come with source.
Hmm. I can only think of a couple games (one that is not even released) that use voxel landscape engines. I wonder which one it could be?
Dan East
HAHA I GET THAT ITS ARGENTUM DUH!!!
DAN MADE A FUNNY JOKE!!!
Novalogic was always boasting about how great their voxel terrain technology was. They produced a number of helicopter flight sim type games.
There was this russian company called Animatek that had a technique for rendering voxel characters, rather than terrain. I don't think they are around anymore.
I think a big problem with voxel technology today is that it's not directly supported by 3D hardware.
The Commanche helicopter series are the ones that stick in my mind - I think they're the ones Digby mentioned (Novalogic).
If you want some source code to look at, have a look at the engines at:
http://cg.cs.tu-berlin.de/~ki/3del_1419_src_feat_land.html
but can i get anything to work on my ipaq...NOOOO!!!
Ghettoboy, narrow the problem down for us. Have you got something working on a standard machine and it won't work on the iPAQ? Let us know what you don't understand and we can try and help you out.
Cheers,
Refractor
Yep... ive got stuff working in openGL.
Ive been trying to use the ipaq3d engine of the Phantoms and this is were i cannot get things to work..
I would love to see some example source for this so then i can see where i am going wrong... as i said im even willing to pay for this..but im beginning to think that only the phantom has done this so may be i should keep on going and if i get something to work then ill post it.
try pocketGL
i forget the URL, do a search on pocketgear.com
its only 50 dollars if i remember correctly
could be exactly what you need
Ive got PocketGL and im not really into using it asit is poorly documented and abstractes a lot of stuuf away from you..this is ok ..but i want to know the knuts and bolts..
thanks for the suggestion
How far into it do you want to go? Do you want to rasterize triangles yourself, or use a lib that does that but nothing else, or what?
I think the latest version of pocketgl had extra calls to make it more low-level, could be wrong though

You got it .. i want to raster triangles and the works do all the clipping etc etc..
Then you dont need any lib at all, you just need direct screen access which you have with EasyCE.
When you say you had it working on the desktop was that doing all the rasterising yourself, or is that something you are trying to add only in the pocket pc version?
By the way, loads of people have done 3d engines for the pocket pc. I know of about 5 at least. I'm working on one myself at the moment, see
www.xengames.com for screenshots.
Phantom, Argentum, and Chopper Alley have voxel terrain engines.
Polygon 3d engines are around as well, there was a game called Christmas Rush (I think that was the name) that looked impressive.
Nope..on the desktop i just use OpenGl or Directx..at the moment Renderware 3.
Its just ive never really done raster stuff and when i got my ipaq and came across easyce it really wetted my appetite.
I looked at your site..very impressive..
Is there any way you could help me..all i want to see is just a wireframe heightmap and how its rendered..i know how to set triangles etc etc..but im not the most inventive person in the world and generally once i see how something is done then im away.
Im sure that its like that for most.
on these boards there is lots of help with where to look ..opengl etc etc..but no pocketPC ..so i find it hard after all im still only 14 and though im capable im still learning.
anyway hope you can help
Sure, I'm happy to help. Do you know how to set up the heightmap, do the rotations and build a triangle list etc. and only need to know how to rasterise triangles, or do you need help with everything?
Well to be honest to see something working and the code .. so i suppose everything...i know how heightmaps ,fractal and voxel engines work...my prob is with all the fixed point math ...so really if i was to see just a small flat or raised grid with clipping done then i would probably be away...
i hope you can help and if so then i have to do something in return to help you as you would not believ how much this is getting to me.
I can probably knock something together for you in a few days time.
It would probably be better though if you just get your desktop code running on the pocket pc. Just do it exactly the same, use floating point maths, and simply replace the triangle drawing stuff with line drawing between the points.
When its working you can THEN think about converting floating point to fixed point, and filled triangle drawing.
Thanks..But easier said than done..
Thats why Directx,OpenGl are great i just say heres a load of vertex info now draw it..
But if do ever have anything i can see then that would be great.
Er, I dont think so. That should be VERY easy. You have the vertex info, all you need to do is step through the vertex list and for each three vertices draw three lines. I'm sure EasyCE has a line drawing function, if not I can easily show you how to do that. What would the problem be?
and clip them and sort them and index them ...
yep easy ce does have a line drawing function for 2d..
As ive said im only 14 and been programming for about a year..so although thsi stuff may be basic to yourself its really difficult to me as we are not even doing calculus in school yet so ive had to learn advanced math..which i have spent most of my time doing..then there is the terminology...
i will crack this ... it may take me a few weeks more yet ,thats why i asked for help as it shortens the learning curve and then when i aquire greater skill i can put something back into the community..
I have been in touch with a games company called Rage and they have offered me a couple of weeks work experience(in may) this is great as i will learn a lot there and then hopefully i can post help for other people ,but i wonder if anyone really wants to help as i have been given lots of information and been told its easy but noone can show me anything working and im not exactly after something ground breaking...just something to help me in the right direction...so that why i ask for help..no other reason..i can even pay for the help as i asked my parents if they could pay for some stuff and they are ok as long as its for education .
anyway thanks once again.
Sorry, I didnt mean to sound like you werent trying hard enough or anything like that. I certainly never wrote a 3d engine when I was 14.
I'm happy to write a simple example for you as I said, I'm just a bit busy at the moment.
If you want to have a go first, basically when you have the vertex list what you need to do is:
1) Possibly rotate them, but I reckon you could skip this to start with.
2) Go through the vertex triplets and:
(i) If any of the three have a z-value less than 1 skip this triangle.
(ii) Calculate three x,y screen values by:
xscreen = 120 + 300 * x / z;
yscreen = 160 + 300 * y / z;
(iii) If any of the x or y values are off-screen skip this triangle
(iv) draw three lines
That will give you a very simple something to look at at least.
Thanks for that ... that has certainly helped..ive been a bit stupid ...arghhhh...i notice that you are setting to centre screen..why was i not..its so obvious..thank you
Yep, the 160 + and 120 + bits are to center.
The 300 * is just to get a good field of view.
Dividing by z is obviously the perspective correction.
Once you've got the basic thing running stuff like rotation to view coordinates, proper clipping, texture mapping and so on are a bit more complex. Fixed point maths is essential if you want > 1 frame per second on the pocket pc. If you arent planning on writing something to release, but just want to learn about 3d engines it would be much better to use floating point maths and write a pc 3d engine. That way you can learn the maths and techniques without it being clouded by messing around optimising for the slower pocket pc.
hey ghetto
I will send you my 3d engine source tommorow, need to compile it and pack all the needed files toghether, hopw it will help you, cu
simon:pretty ncie pictures, can you give us more info? like feature list and how fast it is...(does it support anything besides StrongARM cpu?)
thanks
The game is a 3d space combat game a bit like Starfox. There is more info and more screenshots at:
http://www.infosync.no/show.php?id=1528
It uses a true polygon 3d engine with perspective correct texture mapping and Gouraud shading.
The rasteriser is done in ARM assembler for speed, and it currently runs at 40 fps although not all the optimisations are done yet.
Ghetto Kid wrote in this thread today "Ive got PocketGL and im not really into using it asit is poorly documented and abstractes a lot of stuuf away from you..this is ok ..but i want to know the knuts and bolts.. "
and in my PocketGL forum a couple of days ago he posts asking for help with PocketGL & height map based terrain. I spent hours yesterday researching the topic & deciding on the best way to get from the OpenGL demo to PocketGL only to find he is not serious

No matter, I need a 3D terrain in my next game.
btw: yes the PGL docs are pretty poor but you do get to dig in the source code if you want to. As for me I have 'been there done that' all before so all I care about now is writing games so PocketGL is a real boon as I can do anything 2D but 3D is way beyond my brain

I also think that the Phantom's EasyCE and GAPITools are good looking tools. Wish I had more time
ps: Conan says 'what is best in life', one of them is standing in a games shop watching people pick your title off the shelf
Just noticed it's Ghettoboy here & Ghettokid on my board but both aged 14 with various similarities so must be the same, if not I will grovel
Yep i am the same...
I have found that the people on this board seem to help..where on the PocketGL its go and get the NEHE tutorials and its easy..it is not..and noone can show me what is supposed to be easy....if you are the guy who said you would help..you told me you had already done all this, so why have you spent all day working something out..it would be great as i have told you is you could show me this stuff...and yes using pocketGL..but pocketGL is poorly documented for someone with my lack of experience..i even sent you source code which is pretty basic..
Im sorry if i have offended, but at least on the phantoms forum people are actually showing me the error of my ways...
hmm, does POCKETGL come with source? if so, could anyone send it over to me? I would love to check out their source and compare it with mine...
Conan:well, 3d is pretty simple, as well as 2d, once you spend a few days learning it you will be shocked how simple it all is.... there's just one magic word you need to know.. MATH
Simon:persp correct tmapping, wow, nice job, I use affine mapping, looks fine most of the time - I use hi poly models to hide away lack of persp, tmapping. No asm for me, so persp tmapping probably would be slow like ...........

///
You could always take a look at
http://jaap.flipcode.com/sgade
it's (amongst other things) a software 3d engine for the gba
it is fully fixed point, all the math and clipping is there, and it has a rasterizer in C and arm assembler
and pretty well documented as well..
Mirek: pocketgl comes with source if you pay 50$, it comes without source for free

zen:well, 50$? nah, I don't have it.
and thnx for the url, I will take a look at it.
Mirek asked about sources.
The PocketGL toolkit is $49 but the demo is close to being fully functional & can be downloaded at:-
http://www.pocketgear.com/software_deta ... ociateid=5
V1.0 had everything as source but 1.1 has a lib though most is still source. It works on iPaq & Casio by default but is open to alteration.
Sorry Mirek, my maths is very poor so I'm happy to use a toolkit especially one which does everything I can't manage. Pierre has been very helpful & so far has added some OpenGL functions for me an a 240 x 240 viewport instead of 240 x 320 as this allows me a split 3D/2D screen.
My approach is to use gamedev's tutorials which can be lifted almost intact into PocketGL. For instance getting back on topic, today I used NeHe tutorial 35 for a shaded terrain & only had to convert the rendering to use textures & I had a nice scalable 3D terrain in PocketGL. I need to pre-calculate the vertices to improve performance & then I have what I need.
Conan
conan:well, yeah, but you shouldn't forget, that there are tons of optimizations possible while doing stuff your way instead using someones library.
Refering to opengl tutorials for PPC is a bad ideaa as well, because they work with floats, which aren't an acceptable solution for PPC and there's no way to compare hardware rasterization to software.
Hi Mirek, Don't worry I'm not using any floats. PocketGL is all integer & seems well optimised.
What I'm doing with NeHe OGL stuff is using them to understand what to do in a bit of code that's similar enough for me with my feeble C & poor maths to convert.
Anyway, as a final word on terrain I don't suggest height maps alone as a means of creating lots of terrain as they need to be pretty big to give anything realistic & this does not suit the PocketPC. The one I'm playing with is 1Mb. Lots of samples on generating terrain out there, just need to nail down a nice simple one to use.
conan:well, the easiest and most obvious one is to create a bitmap with random values and then throw smoothing over it.
How to make create a bitmap values you probably know, easiest method for smoothing is something like:
pixel (x+1,y)/4+(x-1,y)/4+(x,y+1)/4+(x,y-1)/4=new pixel(x,y)
you might need to go two-three times with this smoothing over the bitmap to get nice and smooth heightmaps.
Another, better, approach is to make perlin noise. This is a simple way to create awfully large maps which are quite fast to generate.
There are actually many other ways to do it.
Happy programming:)
ok i propose a smoothing function here, i made with the help of u all. works well but a little slow... if you try it and succeed in making in faster please let me know
- Code:
// *********** smooth a clipping *********************************
void smooth( unsigned short xc1, unsigned short yc1, unsigned short xc2, unsigned short yc2, char value)
{
int d1;
unsigned short smoothbuff[320*240]; //is here for the function to work but is declared somewhere higher in real
unsigned short* b1 = wbuff+xc1;
unsigned short* b2 = smoothbuff+xc1;
unsigned short lng=(xc2-xc1)*2;
unsigned short r, g, b;
for ( unsigned char nb=0; nb<value; nb++ )
{
for (int j=yc1; j<yc2; j++ )
{
d1 = j*240;
for (int i=xc1; i<xc2; i++)
{
r = ( (wbuff[i+d1-240] & 0xF800)
+(wbuff[i+d1-1] & 0xF800)
+(wbuff[i+d1+1] & 0xF800)
+(wbuff[i+d1+240] & 0xF800))>>13;
g = ( (wbuff[i+d1-240] & 0x7E0)
+(wbuff[i+d1-1] & 0x7E0)
+(wbuff[i+d1+1] & 0x7E0)
+(wbuff[i+d1+240] & 0x7E0))>>7;
b = ( (wbuff[i+d1-240] & 0x1F)
+(wbuff[i+d1-1] & 0x1F)
+(wbuff[i+d1+1] & 0x1F)
+(wbuff[i+d1+240] & 0x1F))>>2;
smoothbuff[i+d1] = (r<<11)+(g<<5)+b;
}
}
for (int k=yc1*240; k<(yc2*240); k+=240)
memcpy( (b1+k), (b2+k), lng );
}
}
oh i forgot: u need a
- Code:
unsigned short* wbuff;
wbuff = getbuffer();
somewhere higher too
in fact that's part of my own lib which tries to give graphical functions as fire, water, bursts, scrolls, aso... based on EasyCE of course

ehhh, I don't see any code...?!?
and, well, yeah, smoothing this way isn't VERY fast, but it should be acceptable in realtime and very acceptable if you use it during precomputation (or if you use it rarely)
you don't see code ??? forum bug ? i can re read it normaly (?)
for speed, it is ok in real time if you run with value = 1 but in that case, smooth is not enough


I can see the code fine though as I am just starting to figure out what smoothing is it does not help yet. I did manage to get my code to strech out a small 128 by 128 bitmap into a nice looking terrain but whatever I do it will need to be pre-calculated & not from file based height maps.
I have now seen just about every post about fractal terrain generation going past my browser 3 times and downloaded the simple ones to study. As I need to get lots of different planets which can be re-visited (so they must look the same) I need to get a method which holds the basic info in as small an amount of data as possible.
ok I see it now, something is fucked up with those computers at uni:) so Dan, nothing to worry about:)
Anonymous dude,
Register please!
And as for the planets that should look the same at each visit: Just use one of those pseudo random generators that use a seed. By storing the seed per planet, you can regenerate the very same thing over and over again.
And about fractal landscapes; how about this one: Start with a bitmap where all 'pixels' are the same height. Now, take a line that splits the surface in two (not neccessarily equal) halves. Elevate the area to one side of the line. Repeat this a lot of times. Now you have a cool mountain landscape.
Simpler algorithms are the plasma clouds that are available in source code everywhere. Google is your friend.
- Jacco.
Sorry Jacco, I forgot to log in before posting so it came up as anonymous. I logged in but then I could not edit the post.
While looking at all the terrain demos I also came across lots of planet terrain demos also ( ie: a globe with terrain rather than a flat mesh ) so this is another option.
( ps: I hope your new game releases do well )