Jump to content

  • Log In with Google      Sign In   
  • Create Account


iwoplaza

Member Since 06 May 2012
Offline Last Active Apr 13 2014 08:50 AM
-----

Topics I've Started

Cutting of a piece texture with a different texture.

11 April 2014 - 09:20 AM

Hello everybody!

 

Okay, let's say that my application screen looks like that:

 

 

avrhh0.jpg

 

And I want it to look like this:

 

24wga3c.jpg

 

The scenery at the first picture contains of two planes on top of each other that have different textures.

 

What I want is the thing that happened at the second picture. It want it to cut the part of the plane wherever I want based of this texture:

zwbvyu.jpg

 

I am using SDL for handling events, and OpenGL for drawing.

 

Thanks in advance smile.png.

 


Need help: a vector of different extended classes

15 March 2014 - 09:58 AM

Hello there.

 

I want to make a list of entities that are gonna be updated every tick. So, I created a class named Entity, and gave it a couple of functions:

class Entity{
    public:
        int uniqueID;

        Vec3f loc;
        Vec2f res;
        Vec2f vel;
        float rot;

        virtual void onUpdate();
        virtual void onSpawned();
        virtual string getNameID();
        vector<GameData> gameData;
};

Then, I created a vector of these entities:

vector<Entity> entities;

After that, I wanted an arrow entity, so I created a new class EntityArrow that is an extension of Entity:

class EntityArrow : public Entity{
    public:
        EntityArrow();
        EntityArrow(Vec3f argLoc,Vec2f argRes);
        string getNameID();
        void onUpdate();
        void onSpawned();
};

And now comes the problem, when I try to add a new EnttiyArrow to the entities list: entities.push_back(EntityArrow()); it is still treated as an Entity. For instance, if I overrided the onUpdate() function in EntityArrow to print out something in the console, it would do something that is in the Entity's onUpdate() , and not the EntityArrow's. I have already tried to make a vector out of references to Entity class : vector<Entity*> entities , but I still have a lot of problems with it.

 

Is there a better way to do it? Thanks in advance :).


In need of an algorythm!

10 January 2014 - 12:10 PM

Hi.

The picture shows a point and a line in a 2d space. Does someone know what algorythm do I use to calculate the '?' in the picture? It is the distance between the 'point' and the line, but the angle between the line and the "distance line" has to be 90 degrees. I want to use that in my physics engine. And can someone help me find the 3D equivalent of that as well?

 

Thanks in advance!

 

pqrk.png


[HELP] Texture Problems And Low FPS

02 August 2013 - 03:17 AM

Hello everyone. My problem is that on my computer, eveything works fine, I mean, all of the textures are working, fps is great and all. Here comes the problem... on other computers, it doesn't, some of the textures aren't working, and FPS is horrible. The texture thing is probably a power of two thingy, cuz every power of two resolution texture is working, but others are not. What is wrong with the FPS's?

 

Drawing: OpenGL

Texture Loading: DevIL

Language: C++

 

Thanks in advance!


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.

PARTNERS