Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Mi Apr 24, 2024 21:50

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 4 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: volumes from a set of equations
BeitragVerfasst: Di Apr 18, 2006 12:30 
I have a set of equation that set up a volume. For example:

z < 3
z > 0
x^2 + y^2 < 1

which defines 3 planes of a cylinder (bottom plane, top plane and the mantle). Or

x^2 + y^2 + z^2 = 1

which defines a sphere.

I like to model volumes that are defined with these type of equations, but have no experience at all with openGL. Before I start diving into this topic, I'd like to know if it is possible to rendered volumes from a set of equations using delphi and openGL. If this is possible relatively easy, can someone tell me how to start?


Nach oben
  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Apr 18, 2006 13:38 
Offline
Forenkatze
Benutzeravatar

Registriert: Mi Okt 22, 2003 18:30
Beiträge: 1944
Wohnort: Närnberch
Programmiersprache: Scala, Java, C*
Well... It is possible. Not in a direct way, but what you want is possible.

If you want to describe Volumes, you should use a Voxel engine. Today, even voxel graphis can be accelerated by OpenGL and with todays power in modern CPUs it should be possible.
This technique however is very complicated and I've mentioned here just for completeness ;)

What you are aiming for is the calculation of volumes to extract polygonal informations. What I want to say is that you have to create Polygons - triangles - out from these volumes. A sphere i.e. can also be described not by volumes but by trigonometric functions. By using sin and cos you can create a sphere out of triangles. Alternatively you could use the glu Quadrics which provide an easy way for creating speheres an other orimitive objects in OpenGL.

OpenGL ist primary an graphics library. It is not designed for rendering volumes. ;)

_________________
"Für kein Tier wird so viel gearbeitet wie für die Katz'."


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Apr 18, 2006 15:23 
I guess I'm looking for a simpler solution. The problem is, a computer program I will have to work with a lot, uses equations such as the ones I mentioned to set up volumes. There is no way of viewing those volumes, and so I thought that maybe I could write a simple Delphi program to do this, apparently I was over optimistic. I have never worked with openGL, and I sort of hoped you could define volumes, something like objectOpenGL.createSphere(x, y, z, radius) but from your words I take it you have to set up some sort of mesh.


Nach oben
  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Apr 18, 2006 19:42 
Offline
Forenkatze
Benutzeravatar

Registriert: Mi Okt 22, 2003 18:30
Beiträge: 1944
Wohnort: Närnberch
Programmiersprache: Scala, Java, C*
Mithrandir001 hat geschrieben:
I guess I'm looking for a simpler solution. The problem is, a computer program I will have to work with a lot, uses equations such as the ones I mentioned to set up volumes. There is no way of viewing those volumes, and so I thought that maybe I could write a simple Delphi program to do this, apparently I was over optimistic. I have never worked with openGL, and I sort of hoped you could define volumes, something like objectOpenGL.createSphere(x, y, z, radius) but from your words I take it you have to set up some sort of mesh.

Well... OpenGL is based on triangles and other primitives. What types of volumes are you aiming for? As I've already mentioned, the GLU has some helper routines to create spheres, toruses, discs, and some more.

You could, however, simulate volumes with point clouds. You move through a threedimensional array an check - let's say every cm - if this point is in the desired volume. If it is, you can draw a point there with something like this:
Code:
  1. glBegin(GL_POINTS);
  2.   glVertex3f(x, y, z);
  3. glEnd;

x, y and z are your vars in the for-constructs.

You could then adjust the pointsize or alternatively use textures and then you could view volumes ;) This is in it's principles a basic voxel engine accelerated by OpenGL. ;)

_________________
"Für kein Tier wird so viel gearbeitet wie für die Katz'."


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 4 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 15 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.340s | 19 Queries | GZIP : On ]