This site is no longer active and is available for archival purposes only. Registration and login is disabled.

TERRAIN


Postby simonjacobs » Mar 7, 2002 @ 12:19pm

User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Postby ghettoboy » Mar 7, 2002 @ 1:31pm

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
ghettoboy
pm Member
 
Posts: 22
Joined: Feb 21, 2002 @ 2:30pm


Postby simonjacobs » Mar 7, 2002 @ 1:56pm

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?
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Postby ghettoboy » Mar 7, 2002 @ 2:41pm

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.
ghettoboy
pm Member
 
Posts: 22
Joined: Feb 21, 2002 @ 2:30pm


Postby simonjacobs » Mar 7, 2002 @ 3:05pm

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.
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Postby ghettoboy » Mar 7, 2002 @ 4:04pm

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.
ghettoboy
pm Member
 
Posts: 22
Joined: Feb 21, 2002 @ 2:30pm


Postby simonjacobs » Mar 7, 2002 @ 4:15pm

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?
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Postby ghettoboy » Mar 7, 2002 @ 5:15pm

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.
ghettoboy
pm Member
 
Posts: 22
Joined: Feb 21, 2002 @ 2:30pm


Postby simonjacobs » Mar 7, 2002 @ 5:39pm

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.
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Postby ghettoboy » Mar 7, 2002 @ 5:52pm

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
ghettoboy
pm Member
 
Posts: 22
Joined: Feb 21, 2002 @ 2:30pm


Postby simonjacobs » Mar 7, 2002 @ 5:59pm

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.
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Postby MirekCz » Mar 7, 2002 @ 8:29pm

With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Postby MirekCz » Mar 7, 2002 @ 8:30pm

With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Postby simonjacobs » Mar 7, 2002 @ 8:39pm

User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Ghetto Kid - split personality ?

Postby Conan » Mar 7, 2002 @ 10:46pm

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


PreviousNext

Return to Phantom's Forum


Sort


Forum Description

Discuss any of Phantom's projects here (Operation Nutcracker, etc.)

Moderators:

sponge, RICoder, Phantom

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum