Pages: [1] 2 3 4 5 ... 13   Go Down
Author Topic: Free channel: CustomGeometry  (Read 52975 times)
February 08, 2007, 11:19:07 pm
This is a channel I've developed for experimenting with dynamic geometry.  You can create and alter vertex and index buffers from channel code.  It's ideal for stuff like math art and I'd really like to see what others can do with it.

You can use it to make anything.  And THAT, of course, means it's a little complicated to use Smiley

Basically you need to create two arrays.  One for vertex positions and one for render indices.  You could render a cube using 4 vertex positions, one for each corner.  Then your array of indices would need to have 36 entries.  A cube has 6 sides and each side is 2 triangles.  So, the total number of triangles to render is 12.  Each triangle is rendered by way of 3 indices, so the total number of indices is 36.

The indices tell the video card what order to render the vertices in.  Each set of 3 indices renders one triangle and the order matters.  Render the vertices in clockwise order so that it faces the direction you want.  Remember that each rendered triangle is one-sided.

Let me know if you want to play with this and are having trouble.

Here's the DLL.  Put it in the channels folder of your quest install directory and restart quest.

3.6.3 is required.

* CustomGeometry.dll (23.5 KB - downloaded 890 times.)
February 08, 2007, 11:21:38 pm
Here's an example project that renders an imperfect shifting cube with random colors.  It's created with 4 vertices and 36 indices.

* (14.55 KB - downloaded 978 times.)
February 08, 2007, 11:30:48 pm
This example project is much more interesting visually.  It's a slowly morphing field of color-shifting triangles.  The index buffer in this case is very simple and (sort of) unused.  The vertices are just rendered in order.

Give it time to grow for a while.

* (36.55 KB - downloaded 867 times.)

* CustomGeometry2.jpg (26.61 KB, 427x286 - viewed 1353 times.)

* new.jpg (44.17 KB, 814x736 - viewed 1059 times.)

* grown.jpg (63.14 KB, 888x786 - viewed 3111 times.)
February 09, 2007, 05:21:54 am

I had a bit of a play with the channel this morning. It as good fun Smiley

Unfortunately i didnt have have time to finish what i was doing.... but i'll post the result anyway Smiley be warned... its not pretty. The basic concept is going to be that as you click along the points, you can build up a road, or something of the sort. As you can see it doesnt work too well, i just wanted to show another way of using this handy channel.

Thanks, and keep up the good work!

* CustomMesh.rar (561.88 KB - downloaded 957 times.)
February 09, 2007, 10:42:09 am
Dylan, this is great ! Thank a lot for sharing.
February 09, 2007, 12:37:42 pm
Try to delete the channel.lst file in the q3d root folder.

Could be you are missing a 3th party dll, or wrong dx9 version, SDK use  newer dll then redistribute DirectX version.
February 09, 2007, 01:35:21 pm
Looks very cool, Dylan! I can think of a number of interesting applications for it already... Smiley
February 09, 2007, 01:54:07 pm
May you post the sourcecode for this ?
or even from a previous version.. as a template to do dynamic geometry.
February 10, 2007, 12:05:45 pm
This is a fun one - you can create a racetrack just by flying the camera around.  It's sort of like Tron Light Cycles.  It'd be fun to get ODE collision working and drive around on it.

* (38.19 KB - downloaded 790 times.)

* TronRoadPic.jpg (37.36 KB, 617x432 - viewed 1160 times.)
February 12, 2007, 09:23:16 am
...and here's some pics Smiley

I just had to try driving on the track.

* travmania1.jpg (23.74 KB, 546x338 - viewed 1090 times.)

* travmania2.jpg (26.16 KB, 541x378 - viewed 1150 times.)
February 19, 2007, 01:28:49 am
A new version of the channel is attached with a couple bug fixes.

The last child for Performance Mode can be 0, 1 or 2.
0: The vertex buffer is primarily static.  Use this if your geometry changes once every few seconds or not at all.
1: Dynamic vertex buffer.  Use this if your geometry changes (nearly) every frame.
2: DrawPrimitiveUP.  The geometry is rendered without explicit use of buffers.

I haven't noticed any performance difference among the three, but the option is there.

* CustomGeometry.dll (23.5 KB - downloaded 717 times.)
February 19, 2007, 02:01:42 pm
Same here  Yummie
also one of us may find a way to add textures & collision.
February 19, 2007, 05:38:07 pm
Yes, I do plan to release the source.  The whole idea behind this channel though is to enable stuff that normally requires the SDK to be done without it.

The new version now works with collision and textures can be mapped using the 4th child (a vector).  Use x for tu and y for tv at each vertex.
February 19, 2007, 06:05:03 pm
I agree, the idea to make this usable without any sdk is really great.
From those sample, i also see it work really well.

For some particular cases that will ask a large amount of computation like lod terrains, i guess c++  is still needed.

Wow, you made it with collision + texture allready.. respect.
the only negative point is i don't see feature to try to add in return now Smiley
February 19, 2007, 10:26:45 pm
Hi Dylan,

A great channel, cool, respect!!

The performance is really great!

And if you release the code, that is really great  Kiss Kiss Kiss
Pages: [1] 2 3 4 5 ... 13   Go Down
Jump to: