Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

iwoplaza

Member Since 06 May 2012
Offline Last Active Apr 21 2013 11:51 AM
-----

Topics I've Started

Vertex position get from camera

01 September 2012 - 09:01 AM

I have a question. How can I get vertex positions from camera view in OpenGL. Example:

Posted Image
Wherever the camera is, I want to get vertex positions from camera view.


I'm using OpenGL for drawing.

I'm from Poland so if you could use some clear language.


Thanks in advance.

Vertex/Model Selection in my Modeler Program.

26 August 2012 - 01:21 PM

I have a problem. I wrote a modeler to create models with my format, but I want to be able to select individual vertices with my mouse or select which model I want to edit. Screen of the program:

Posted Image

So can you give me some tutorials or tips.

I'm using:
OpenGL - drawing.
DevIL - images.
fStream - FileLoader.

I'm from Poland so if you could use some clear language.

Thanks in advance.

Problem with functions!

23 July 2012 - 06:54 AM

I would like to create buttons. And when you click them, do some functions.
But i have problem with button actions Posted Image.

Some of my code:

//---- Header File----
class Button{
	public:
		//variables initiating like float x,y,z...
		void func(void);
		void draw(){
			//Some drawing
		}
		void CheckButtonClick(float mx, float my,int key,int state){
			if(mx >= x && mx <= x+w &&
			   my >= y && my <= y+h &&
			   state == 0 && key == 0){
				  click = true;
				  func();
			}else
				  click = false;
		}
};

//----Main File----

void AddButton(Button &button,string text,void func(),float x,float y,float z,float w,float h,float s,float r,float g,float b,GLuint tex,GLuint clicktex){
	 button.tex = tex;
	 button.clicktex = clicktex;
	 button.func() = func();
	 button.textsize = s;
	 button.text = text;
	 button.x = x;
	 button.y = y;
	 button.z = z;
	 button.w = w;
	 button.h = h;
	 button.color[0] = r;
	 button.color[1] = g;
	 button.color[2] = b;
}


Button button_file,

void close(){
	 exit(0);
}


void InitRendering(){

	_buttondark = loadTexture ("Data/IvoGui/buttondark.tga");
	_buttondark_click = loadTexture ("Data/IvoGui/buttondark_click.tga");

	AddButton(button_help,"Pomoc",close(),133,5,0.001f,64,16,0.9f,1.0f,1.0f,1.0f,_buttondark,_buttondark_click);
}

It gives me an error:
invalid use of void expression

Without button actions everything works fine.
Can you help me with this actions?

Thanks in advance.

FStream Problem

19 July 2012 - 08:30 AM

I have a problem with the library "fstream", because I'd like to read 100 characters by using the FOR loop. For example, a text file from I want to read the characters look like this:
A
B
C
D



And I want to read the characters one by one to four variables CHAR using a loop.
But I do not know how to do it Posted Image. Can you help?

Thanks in advance.

Random number problem!

19 June 2012 - 08:53 AM

I'm making three-dimensional application in OpenGL, which generates a random blocks in the world (something like Minecraft). This is my script to generate blocks:

void GenBlocks(){
	 int currblock;
	 int currXline;
	 int currZline;
	 int randID;
	 for(currblock = 0,currXline = 1,currZline = 1;currblock < blockAM;currblock++,currXline++){
		   randID = rand() % 2 + 1;
		   if(currXline > pierw(blockAM)){
			  currXline = 1;
			  currZline++;
		   }
		   block[currblock].x = currXline*3;
		   block[currblock].y = 0;
		   block[currblock].z = currZline*3;
		   block[currblock].id = randID;
	 }
}

But every time when I run the application, it generates the same!

Thanks in advance.

PARTNERS