March 28, 2024, 09:52:25 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


about Ebasic 3d capabilities

Started by talun, April 22, 2008, 02:08:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

talun

Hi,
if possible I would need some explanations and suggestions about the 3d graphics capabilities of Ebasic.
For our job, we simulate the production of fracture systems in rock masses. The fracture surfaces are represented  by polygons with three to sixteen sides, with different color according their system,  and the resulting files can contain different thousand of polygons (124000 in our last simulations). The files are in ASCII format and contain all the necessary information for the drawing (polygon color, vertex coordinate, â€Ã,¦.).

Now my questions:
- Is it possible to handle (zoom, rotation and hidden lines removal) this big number of polygons with the Ebasic 3d routines?
- If I succeeded in drawing the polygons, is it possible to save the drawing in a 300-600 dpi bitmap format ?

Thanks!

Sergio

RG

Sergio,

I've created meshes with well over that number and can easily zoom and move them. I have not done hidden line removal as I use textures (so underlying polygons are covered). I will need to check to see how large I've gone.

As far as I know, the 3D routines require polygons to be defined as triangles. So polygons of larger vertices would need to be defined in terms of triangles whcih will add to the polygon count.

Rich

talun

Hi Rich,
thank you for the reply.
You are right for the triangle problem and in the output files the triangle vertex are in fact defined (the files are in the ASCII format of  GOCAD,  a very powerful software broadly used for geomodeling tasks). Below you can see a sample record of the GOCAD ASCII format, that contains all the necessary data for the polygon drawing.

GOCAD TSurf 1
HEADER {
name:XPC12-C15_modificato:Set_1_1
*solid*color:0.857019 0.0142435 0.528737 1
}
GEOLOGICAL_TYPE fault
VRTX 1 -21.4 5.08 -5.37
VRTX 2 -20.2 -3.67 -8.93
VRTX 3 -17.1 -11.4 -4.26
VRTX 4 -14.6 -11.9 4.92
VRTX 5 -14.6 -5.29 11.1
VRTX 6 -16.9 3.41 10.3
VRTX 7 -19.9 7.95 3.06
TRGL 1 2 3
TRGL 1 3 4
TRGL 1 4 5
TRGL 1 5 6
TRGL 1 6 7
END                                                             

For the biggest simulation, the triangles count is about four times the poygon count (123995 polygons = 491690 triangles) and therefore I don’t know if this big number of objects is manageable by Ebasic 3D routines.
Moreover I’m intersted to save the drawings with a decent resolution (at leat 300 DPI), because the graphic quality that we currently get is very scarce and therefore i would like to try to write a visualization program in Ebasic.

bye

Sergio


J B Wood (Zumwalt)

Most engines only handle a max of 65000 polies per model. Unity for instance, one of the commercial programs I own, does not support more than 64000 polies per model. I have autogenerated models (via MEL script) that have a base of 85000 polies. It doesn't make much sense to me why engines (btw Unity base price for Indy license starts at $199 and only runs on Mac, if you want it to run on a PC, you have to pay $1499 without asset server, and $1999 with asset server), where as EBasic / Aurora are Free.

Now, a $2k software that can't support over 64k poly's per model should say something about the need for optimization or poly count per model.
If you really need to go large in your poly count, think about splitting the model into pieces and loading up the pieces then seem them together. Its a visual illusion that makes the model seem whole, when it is really in parts. The scene itself really doesn't have a poly max limit, its the individual models that have poly max recommendations. In truth a model really has no poly max just machine value max, so if you use the max value for a poly count, you could be in the trillions, but there isn't a video card on the planet in a persons home machine that will load a single model of that magnitude.

talun

Hi Jonathan,
many thanks for your reply and for the very clear explanations.
For now I have resolved my problem by writing a simple VRML 1.0 converter and I have loaded my models in a CAD software,  where I can to modify and to save in the requested  format.
Hovewer I would be interested to use the 3D Ebasic capabilities but unfortunately I am a total beginner and I don't succeed in understanding the examples and I have not understood yet if Direct3D automatically scale the models to the drawing area or if it is necessary to write the scaling routines.
IMHO it would be very useful a tutorial similar to those for Opengl, that begins with the simpler operations as drawing and modify simple geometric forms.

bye!

Sergio

J B Wood (Zumwalt)

"scale to drawing area" is an illusion.
all it is doing is actually moving the camera closer or farther away in the instance of the scene.

Ok, lets put this in a different refference.
3D space in a computer is huge, so vastly huge, that it actually is infinite.
Scale is a base line in which you design things to show in 3D space.
In theory, if a computers CPU/GPU could handle the rendering of earth fully hightmapped and all the tree's plants, animals, houses, etc, then the moon, then all the other planets in our system, then all the systems in our galaxy, then all the galaxies in the universe, you could create them all to physical scale.

You could, in fact, recreate the structure of everything in 3d space.
Actually I saw a Cray render earth this way once in Orlando.
I swore the thing was a huge jukebox the first time I saw the machine with its neon liquid cool chambers on each side of the machine. Anyway...

Scale is yet another form of control for a scene, everything must be within scale to understand its size in comparison only to things around it. Now, for zooming, you add yourself motion to your camera, so you can move the camera in or out, around or about, to see the model in the size you wish, you don't actually rescale the model to fit the window, you move the camera to make the model fit the camera viewing space.

Then there is render distance. You have to increase the render distance to fit how far away the camera can be before the object starts to disappear.

Everything in the 3D world boils down to CPU/GPU limitations, it is all that matters.

RG

July 04, 2008, 12:12:20 PM #6 Last Edit: July 04, 2008, 12:25:16 PM by RG
I finally converted one of my larger programs from Ibasic to Ebasic. That let me test how many polygons a mesh could have before the display stopped displaying all of the polygons. The cutoff appears to be around 240,000 in one mesh.

Rotating and transposing that size mesh appears about instantaneous, even on an older computer.

Recalculating the entire mesh takes about 1 second.

Note: these polygons are all triangles.

Rich

talun

Hi Jonathan and Rich,
many thanks (with big delay..) for your reply.
Rich, if possible for you, can you post a simple code snippet for "minimal" drawing of triangles with defined vertex coordinates?
Thanks!

Sergio


RG

This is one example (more than a code snippet). If too complicated, I can try to idenitfy the key parts.

Rich

http://www.ionicwind.com/forums/index.php/topic,2000.msg21383.html#msg21383