Drawing 3D model in GUI.

Started by kol999, April 07, 2012, 12:57:25

Previous topic - Next topic

kol999

I have got a model class. It has a rendering method:
public void renderModel(float f5, boolean b)
  {
	    if(b) {Crystal.render(f5);}
	    else
	    {
		    Down.render(f5);
		    Corner1.render(f5);
		    Corner2.render(f5);
		    Corner3.render(f5);
		    Corner4.render(f5);
		    UpCorner1.render(f5);
		    UpCorner2.render(f5);
		    UpCorner3.render(f5);
		    UpCorner4.render(f5);
		    Tower1.render(f5);
		    Tower2.render(f5);
		    Tower3.render(f5);
		    Tower4.render(f5);
		    Border1.render(f5);
		    Border2.render(f5);
		    Border3.render(f5);
		    Border4.render(f5);
		    add1.render(f5);
		    add2.render(f5);
		    add3.render(f5);
		    add4.render(f5);
	    }
  }


I need to draw this model in GUI menu(Draw this model on screen on specifed position.). How to do this?

P.S.
I am making a mod, so i dont know how the game draws the graphic - it usialy just calls a method with X Y & Z params and i can just set lighting, translation & rotation, and draw the model using the method shown above.
P.P.S
Sorry for bad english.

RiverC

It probably depends on the state of the OpenGL state machine when your Crystal model's render method is being called. Can you figure out what it is doing at that time? That will have a large impact on what the result of your render will be.

Probably, you'll ultimately just need to offset all the vertexes in your model by some amount to get them in the right place, provided you are able to draw a 3d model in the GUI (it may be a 2d GUI, or there might be complications.)