How can i render a tiled map with C++/SDL [closed] - c++

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I want to render tiles to the screen from a text file. I have the random terrain generator working, and I can move the data from the text file to a 2d vector. What I'm having trouble with is understanding how to give those tiles the coordinates they need to be rendered at. How would I go about assigning each tile its own coordinates relative to the camera?

I suggest checking this lua tutorial on how create a tile engine in great detail. You'll learn much more then what someone will be willing to post here on stack. Tile Engines as you will see from this tutorial, requires more then just a few lines of code. After you learn it here, it shouldn't be to hard for you to translate it to sdl/c++. Just a thought.
Its a good starting place.

Related

Low frame rate in OpenGL [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a blender obj. file in an OpenGL application. I have also added a camera so that it will move in around that object (it's a building, so it's pretty large). The frame rate on it is awful.
Why is it slow and/or how can I make it faster?
void camera (void) {
glRotatef(xrot,1.0,0.0,0.0);
glRotatef(yrot,0.0,1.0,0.0);
glTranslated(-xpos,-ypos,-zpos); }
This is just my simple camera class. Just in case it helps.
There are some reasons your code might be slow:
You aren't using VertexBuffer objects
You are using the fixed function pipeline and not shaders
You aren't optimizing your drawing code that only areas are rendered which are visible ( look a.e. for bsp-trees )
After all you've a lot of optimizations to do. I would start with optimizing my render pipeline and remove the fixed function pipeline and start to use shaders and vertex-buffers.

How to add hair in OpenGL [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have a 3D head model. How can I add hair? I only need to draw hair and animation is not required.
Could anyone provide some sample code? What is the simplest way to simulate hair in this case?
Edit:
I understand this is not a programming problem. But I have to implement it as my project. I searched online, which makes me more confusing. That is why I asked here.
Static hair can be rendered in a variety of ways depending on your needs:
Using a polygonal model. This gives hair that looks like what the characters from Dragon Ball or Yugi Oh! have.
Using a fur rendering algorithm. This is a very fill-rate intensive process.
Using multiple disjointed polygonal models. This works well for dreaded hair and in general hair which isn't too "fluffy".
These are just from the top of my head. There are most likely other algorithms out there. Also, as cbamber85, hair rendering is indeed a research field in itself!

How to introduce keyboard functions in Opengl code [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am new to opengl I tried to make an isosurface by reading from a text file .now I want to introdude keyboard functions in my code so that I can rotate an do all that stuffs. please tell me from where i can study that or give me a sample code
Sudhanshu
OpenGL only deals with drawing stuff. It gives you a canvas and some primitive drawing tools. Nothing more. Anything beyond that is the task of the user interface system provided by the OS.
Maybe you're using GLUT and are mislead by its name. GLUT is not part of OpenGL; it's a rudimentary framework aimed at developing simple OpenGL example programs, but that's about it.

Draw image from text file using OpenGL [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have a text file containing the vertices of a triangle. I would like to draw this triangle in an OpenGL window; however, I am quite new to OpenGL and am not sure where to get started.
Can anyone point me in the right direction or provide a general outline as to how I might get started with this problem? Thanks in advance for any help.
This should help you.

Remaking Star Fox using DirectX [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I'm trying to remake the game of Star Fox for the N64. Right at the time I'm having trouble with collisions and getting the my ship to shoot like it suppose.
The biggest challenge I'm having right now is getting the aiming box for this game
anything would help.
sorry I didn't notice that half of my question was cut off. link to source code
Right now I'm trying to get box collisions to work. Also how do you put a bounding box on a primitive like a Cylinder, Torus, ect.
also so .X files would be just as good help if you know any sites.
Sorry, without more information...