Welcome, Guest. Please login or register. Did you miss your activation email?

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 - ezio160324

Pages: [1]
1
Graphics / Re: So, can't use sf::Texture as a const
« on: August 15, 2014, 03:11:18 pm »
I see where you come from. But sometimes I miss the simplest things. Such as, it can't seem to find the texture. I'm sure I'm missing something so dang simple.

EDIT: Ah, it was indeed something simple. Fixed! :D

Except model is now black. Will be fixed soon! :p

EDIT: How odd, it seems to only take the outer edges of the texture. My texture is black around the edge. So the model is black. I try another texture that is white around the edges, model is white.  ???

2
Graphics / Re: So, can't use sf::Texture as a const
« on: August 15, 2014, 02:45:59 pm »
Quote
There isn't a single sf::Texture in the ObjModel class.
There are no sf::Texture* in that whole file.

https://github.com/binary1248/SFML/blob/master/examples/3d/3d.cpp

Tell me what line you are referring to.

I'm saying that when I have a model
        ObjModel model;
        model.loadFromFile("model.obj")

like that and try to use
sky.setTexture(texture);
it fails because it requires said texture to be like

sf::Texture *texture;
aka a const. But, my problem is, when I try to load a texture with it being
sf::Texture *texture;
my program crashes. I guess I worded my question wrong, initially.

3
Graphics / Re: So, can't use sf::Texture as a const
« on: August 15, 2014, 02:23:28 pm »
        sf::Texture *texture;
texture->loadFromFile("texture.png");

That's the function. I guess.

I'm talking in your *.obj class that came in the 3d example file.

4
Graphics / So, can't use sf::Texture as a const
« on: August 15, 2014, 02:11:13 pm »
So, I'm using this 3D fork of SFML by binary1248. I've run into a problem. His *.objs require
const sf::texture
as the texture. Only problem, it my program crashes if I try to create an
sf::texture
as const. Any ideas?

5
Window / Re: First Person 3D Camera?
« on: July 16, 2014, 02:27:06 pm »
Could be any number of things, you'll have to scour the code thoroughly. I know it depends on glu and glm for one thing. If you can't find what you need in the code have you looked at this? It has added 3D support.

Wow, got it working. Thanks so much. Now to get to work on my skybox......

EDIT: Well, I'm trying to limit the vertical rotation. It's not working. I copied the camera code from the 3d.cpp file at the link.  :-\ I am at a loss.

6
Window / Re: First Person 3D Camera?
« on: July 15, 2014, 01:52:37 pm »
I see. I did try it, it didn't work. Could it be because I'm on Windows 8.1 using VS 2013?  :-[

7
Window / Re: First Person 3D Camera?
« on: July 15, 2014, 01:04:57 pm »
I made a framework based on SFML which supports first person camera via a 3D scene graph. It doesn't use very modern openGL, but you should be able to extract it from the 'mesh' folder (don't forget the headers in /include). There're no docs though, so you'll have to try and figure it out from the comments

Does it really require Box2D? Cuz I'm using Bullet for physics.  :-\

8
Window / Re: First Person 3D Camera?
« on: July 15, 2014, 12:20:57 pm »
Thanks. That should help until I get ready to do some real rendering. And yeah, I have learned a little OpenGL. I'm still learning.

9
Window / First Person 3D Camera?
« on: July 15, 2014, 11:08:56 am »
Hey. I'm wondering if anyone has made anything to help with a 3D first person camera. I saw sf3d but it's not for SFML 2.  :( Anyway, if nobody has done such a thing, can you give me some pointers on where to start?

10
Window / Re: Certain events only working with framelimit on or off
« on: July 13, 2014, 01:53:23 am »

#include <btBulletCollisionCommon.h>
#include <btBulletDynamicsCommon.h>
I don't think you really need to be testing collisions etc. in this code  :P

Ha, I just have it there for once I'm ready to use it.

But thank you both I got it working now.

11
Window / Certain events only working with framelimit on or off
« on: July 13, 2014, 12:53:07 am »
I am working with a simple window that plays some music and shows a red circle. In my code, the code I have to lock the cursor to the center only works with framelimit off. Also, my code for pressing 'esc' to close the window only works with it on. It's confliction. Here's my code:

#include <SFML\System.hpp>
#include <SFML\Config.hpp>
#include <SFML\OpenGL.hpp>
#include <SFML\Window.hpp>
#include <SFML\Graphics.hpp>
#include <SFML\Audio.hpp>
#include <btBulletCollisionCommon.h>
#include <btBulletDynamicsCommon.h>


sf::Event event;
sf::Event event2;
sf::Event event3;


int main() {


        sf::Music music;
        if (!music.openFromFile("meh.flac"))
                return -1; // error
        music.setLoop(true);

        sf::RenderWindow window(sf::VideoMode(800, 600), "OpenGL");
        sf::CircleShape shape(50.f);
        shape.setPosition(100, 0);
        shape.setFillColor(sf::Color::Red);

        sf::Mouse::setPosition(sf::Vector2i(400, 300), window);

        music.play();

        while (window.isOpen())
        {                      
                //input handler loop
                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) {
                        window.close();
                }


                //event handler loop
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed) {
                                window.close();
                        }
                }

                while (window.pollEvent(event2)) {
                        if (event2.type != sf::Event::MouseLeft) {
                                sf::Mouse::setPosition(sf::Vector2i(400, 300), window);
                        }
                }

                        window.clear();
                        window.draw(shape);
                        window.display();

                }
       

                return 0;
        }

I'm very sensitive about my code, too, so please don't make fun of me for it.  :)

Pages: [1]