Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - marlon

Pages: [1] 2
1
Projects / Re: My new INTRO
« on: May 16, 2012 »
yea..  nize.. =)
It have to me like a.. Lord Of The Rings (eye) effect !

Me like!  =)

2
First I setup Opengl in some PreInitialization...
When that is done I use a window to print what is Calculating and Loading..
The Calculations and Loading routines are called from the Thread..
..

So..
1. Initialize OpenGL
2. Start a Setup Routine That is calling a Thread to do the Calculation and Loaidng.. (The Thread is calling several routines)
3. The Setup Routine also Prints out the Status of the Thread..
4. When The Setup Routine is Done my SceneDrawing is Starting up instead..

It looks like everything is loading and calculating.. but..
Then it comes to setting up the VBO in the Thread..
Boom..  =(

-> glGenBuffers( 1, &cJellyBall->vBuf);
     glBindBuffer( GL_ARRAY_BUFFER_ARB, cJellyBall->vBuf );
     glBufferData( GL_ARRAY_BUFFER_ARB, cJellyBall->m_iNumVertices * sizeof(VECTOR3D), cJellyBall->m_rgsVertices,    GL_STATIC_DRAW_ARB );


This is where it stops.. All my objects are created dynamically..
But says that it got some adress violation..  Humm..  =(



3
I am thinking of it is possible to run my Initialize thread from my MainMessageLoop?
All that thru a CreateThread...

The CreateThread Function will initialize all the stuff and then put the Status/Progress in some global variable/variables and then let the MainMessageLoop print that to the screen.. When the thread is finished the Intro/Demo will continue..

Yes?

-marlon

4
ok.. thanks Raizor

I will take a look at it!   =)

5
Hello all you mighty DBF'ers!   =)


Before my code is running I am initializing some stuff..
Loading my heightmap into the grid and calcing all the normals for that..
Then I do that Icosahedron for my jellyball..
And loading textures for those..

But when all those things are in progress I can not see anything on screen.. Just white screen..
I would like to print out some text and maybe a progressbar so I can follow what is going on..
But it is like I do not get anything on screen except when I run things from my MainWinLoop...

Anyone got any clues on how to do this..?

-marlon

6
C / C++ /C# / Re: fps..
« on: April 25, 2012 »
would it be possible to aim for a certain fps rate (maybe 60) and then discard all frames above?

7
C / C++ /C# / fps..
« on: April 25, 2012 »
Hello all you mighty coders in here!  =)


FPS.. Not "First Person Shooter"
but frames per second..  hehe

My problem is that when I have coded something I have different results of speed on my cousins pc and on my own..
My pc shows a very fluid motion in the rotation of my 3d.. But on my cousins pc in the other hand it is the same fluid motion but it takes ages for the rotation to switch to opposite rotation.. How can I rotate it, so it will rotate in the speed and maybe skip some frames instead??

http://www.marlonbodhi.com/GPUjello.rar

It is the Grid/Heightmap that makes the worst problems..


- Marlon Bodhi

8
C / C++ /C# / Re: Memory problem..
« on: April 02, 2012 »
Now I have tried my code in some Mesh class..
Still messes up when trying to use bigger Heightmaps for the Y-value on the grid..
And on top of that all my normals look like they are inverted all of a sudden..

Weird..  I really thought I had it going..  I guess I do not have enough time to concentrate on my code because of my work..
Need to let all this coding rest for some time now..  Damn..!

Thanks for all your help you guys!
Will be back soon I hope with some better results..

/ marlon

9
C / C++ /C# / Re: Memory problem..
« on: March 28, 2012 »
It is so many years ago I have been programming..  so many things are forgotten..  damn..  =(

This is my MeshClass so far..

class CMesh {

   public:

         CMesh();
         ~CMesh();

         VERTEX               * m_rgsVertices;
         VERTEX               * m_rgsNormals;
         COLOR               * m_rgsColors;
         TEXTURE               * m_rgsTexture;

         INDEX               * m_rgsTriangleIndeces;
         VERTEX               * m_rgsTriangleNormals;

         unsigned int            m_iNumIndeces;
         unsigned int            m_iNumVertices;
         unsigned int            m_iNumTriangles;

};

10
C / C++ /C# / Re: Memory problem..
« on: March 27, 2012 »
Yes.. I should learn how to use the debugger..  =)

But all my code here is pretty much hardcoded..
And my arrays of vertices, normals etc goes something like this..

vertices[i*3+0]      (x value)
vertices[i*3+1]      (y value)
vertices[i*3+2]      (z value)
normals[i*3+0]      (x value)
...

all are globals and I have many arrays and now I would like to keep it more simple to structure so I would like to make some structs and classes to put all that stuff in instead..
And have those objects draw themselves when done..  =)


11
C / C++ /C# / Re: Memory problem..
« on: March 26, 2012 »
nope..  =(

I only use INTs for loops.. And all the values come from the dimensions of the TGA I use for the heightmap..
I think I will delete the code and start all over.. New start..

12
C / C++ /C# / Re: Memory problem..
« on: March 26, 2012 »
it is just weird..  because it is working fine with a heightmap with less dimensions of 256x256..

13
C / C++ /C# / Memory problem..
« on: March 26, 2012 »
Hello folks!  =)


I got this grid working with some heightmap on..
I create my x and z values with the dimensions from the heightmap..
So the x is going from -((heightmapwidth-1)/2) to ((heightmapwidth-1)/2)
And the z is going from -((heightmapheight-1)/2) to ((heightmapheight-1)/2)

When I use up to a heightmap of 256x256 it is fine.. But when I use a higher dimension..:   Program is not responding..  =(

I am using Visual Studio 2010..  It looks like I have some problems with the memory.. Maybe not enough set up?
I use NEW when allocating my memory arrays..
Any clues on this?


Thanks in advance!
Marlon Bodhi.

14
C / C++ /C# / Re: jelly vector / dragon ball
« on: March 18, 2012 »
i found my error..

the arrays for the vertices and the triangles are setup like Vertices*3 (for x,y,x) and Triangle*3 (for v1, v2,v3)

So i made like this :   IcoVert[tindices[i*3+2]+0]

should have been:    IcoVert[tindices[i*3+2]*3+0]



15
C / C++ /C# / Re: jelly vector / dragon ball
« on: March 17, 2012 »
the red book uses a 2dimensional array..  when i change to a 1dimensional the data is all messed up..
weird.. 


GLuint  * IcoPoly;
GLfloat * IcoVert;
GLfloat * IcoNorm;

GLuint tindices[] = { 0,4,1, 0,9,4, 9,5,4, 4,5,8, 4,8,1,
8,10,1, 8,3,10, 5,3,8, 5,2,3, 2,7,3,
7,10,3, 7,6,10, 7,11,6, 11,0,6, 0,1,6,
6,1,10, 9,0,11, 9,11,2, 9,2,5, 7,2,11 };

..

void InitIcosaHedron() {

   #define X .525731112119133606
   #define Z .850650808352039932

   IcoPoly = new GLuint[20*3];
   IcoVert = new GLfloat[12*3];
   IcoNorm = new GLfloat[12*3];
 

   IcoNorm[ 0] = (GLfloat) -X;      IcoNorm[ 1] = (GLfloat) 0.0;      IcoNorm[ 2] = (GLfloat)  Z;
   IcoNorm[ 3] = (GLfloat)  X;      IcoNorm[ 4] = (GLfloat) 0.0;      IcoNorm[ 5] = (GLfloat)  Z;
   IcoNorm[ 6] = (GLfloat) -X;      IcoNorm[ 7] = (GLfloat) 0.0;      IcoNorm[ 8] = (GLfloat) -Z;
   IcoNorm[ 9] = (GLfloat)  X;      IcoNorm[10] = (GLfloat) 0.0;      IcoNorm[11] = (GLfloat) -Z;

   IcoNorm[12] = (GLfloat) 0.0;      IcoNorm[13] = (GLfloat)  Z;      IcoNorm[14] = (GLfloat)  X;
   IcoNorm[15] = (GLfloat) 0.0;      IcoNorm[16] = (GLfloat)  Z;      IcoNorm[17] = (GLfloat) -X;
   IcoNorm[18] = (GLfloat) 0.0;      IcoNorm[19] = (GLfloat) -Z;      IcoNorm[20] = (GLfloat)  X;
   IcoNorm[21] = (GLfloat) 0.0;      IcoNorm[22] = (GLfloat) -Z;      IcoNorm[23] = (GLfloat) -X;

   IcoNorm[24] = (GLfloat)  Z;      IcoNorm[25] = (GLfloat)  X;      IcoNorm[26] = (GLfloat) 0.0;
   IcoNorm[27] = (GLfloat) -Z;      IcoNorm[28] = (GLfloat)  X;      IcoNorm[29] = (GLfloat) 0.0;
   IcoNorm[30] = (GLfloat)  Z;      IcoNorm[31] = (GLfloat) -X;      IcoNorm[32] = (GLfloat)  0.0;
   IcoNorm[33] = (GLfloat) -Z;      IcoNorm[34] = (GLfloat) -X;      IcoNorm[35] = (GLfloat)  0.0;

       int i;

for (i = 0; i < 12; i++) {

   IcoVert[i*3+0] = IcoNorm[i*3+0];
   IcoVert[i*3+1] = IcoNorm[i*3+1];
   IcoVert[i*3+2] = IcoNorm[i*3+2];

}

float scale = 20.0f;



for (i = 0; i < 12; i++) {
   IcoVert[i*3+0] *= scale;
   IcoVert[i*3+1] *= scale;
   IcoVert[i*3+2] *= scale;

}


}

void DrawIcosaHedron(int smooth) {

int i;

GLfloat v1[3];

glBegin(GL_TRIANGLES);
for (i = 0; i < 20; i++) {

   v1[0] = ( IcoNorm[tindices[i*3+0]+0] + IcoNorm[tindices[i*3+1]+0] + IcoNorm[tindices[i*3+2]+0] ) / 3.0f;
   v1[1] = ( IcoNorm[tindices[i*3+0]+1] + IcoNorm[tindices[i*3+1]+1] + IcoNorm[tindices[i*3+2]+1] ) / 3.0f;
   v1[2] = ( IcoNorm[tindices[i*3+0]+2] + IcoNorm[tindices[i*3+1]+2] + IcoNorm[tindices[i*3+2]+2] ) / 3.0f;
   ReduceToUnit(v1);


glNormal3f(v1[0], v1[1], v1[2]);
if(smooth)
glNormal3f( IcoNorm[tindices[i*3+0]+0], IcoNorm[tindices[i*3+0]+1], IcoNorm[tindices[i*3+0]+2] );
glVertex3f( IcoVert[tindices[i*3+0]+0], IcoVert[tindices[i*3+0]+1], IcoVert[tindices[i*3+0]+2] );
if(smooth)
glNormal3f( IcoNorm[tindices[i*3+1]+0], IcoNorm[tindices[i*3+1]+1], IcoNorm[tindices[i*3+1]+2] );
glVertex3f( IcoVert[tindices[i*3+1]+0], IcoVert[tindices[i*3+1]+1], IcoVert[tindices[i*3+1]+2] );
if(smooth)
glNormal3f( IcoNorm[tindices[i*3+2]+0], IcoNorm[tindices[i*3+2]+1], IcoNorm[tindices[i*3+2]+2] );
glVertex3f( IcoVert[tindices[i*3+2]+0], IcoVert[tindices[i*3+2]+1], IcoVert[tindices[i*3+2]+2] );
}
glEnd();


}



The vertices looks like they are placed right but the rest is garbage..

16
C / C++ /C# / Re: jelly vector / dragon ball
« on: March 17, 2012 »
I am trying to make that jelly ball now using a icosahedron from that Red Book..
But I need more face that the initial 20.. So I subdivide a few times to get a better facecount..
But how do I gather all these new vertices and faces in a Triangle-Strip?

17
HellFire..  WOW!    :clap:

18
C / C++ /C# / Re: jelly vector / dragon ball
« on: March 03, 2012 »
yes..  those diagrams look very pro!   

http://www.marlonbodhi.com/lol.avi

19
C / C++ /C# / Re: jelly vector / dragon ball
« on: March 02, 2012 »
all the vertices and vertexlist are done in hand..  Just drawing it on paper and then tried to put it in VC++

i am using an example from nehe to set up the windows and opengl.. because now i rather wanted to learn some opengl than using to much power on struggling with the other things..


http://www.marlonbodhi.com/humm.avi

20
C / C++ /C# / Re: jelly vector / dragon ball
« on: February 29, 2012 »
one in wireframe and one in solid and one mixed..

Pages: [1] 2