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

Pages: 1 [2] 3 4 ... 18
16
Graphics / Textures not tiling properly
« on: July 29, 2009, 03:13:52 pm »
Quote from: "Jaenis"
Also a bit offtopic, why OpenGL 1.2 would be a restriction? :wink:


To support crappy old integrated graphics chipsets perhaps. Like my Intel GMA 950, but I can actually use version 1.4 :)

17
SFML projects / Squeebs, a 2d comic mmorpg
« on: July 22, 2009, 02:40:48 pm »
Ok, I will try it on 2 of my other computers (should have done that already but I'm lazy :P)

18
SFML projects / Squeebs, a 2d comic mmorpg
« on: July 20, 2009, 02:09:17 pm »
Any news on why it won't download all the files on my computer (Win XP Pro SP3)?

19
Graphics / Dislpaying floats
« on: July 11, 2009, 11:11:15 pm »
You could do it like this assuming c++ being used:

Code: [Select]
#include <sstream>

sf::String fps;
std::stringstream ss;
ss << 1.f / renderWindow.GetFrameTime();
fps.SetText(ss.str());
fps.SetPosition(10, 10);
fps.SetColor(sf::Color::Black);
renderWindow.Draw(fps);

20
General / Trigonometry, float or double?
« on: July 07, 2009, 12:46:36 am »
thanks for the tip, I have read about it but I will check my code again.

21
General / Trigonometry, float or double?
« on: July 06, 2009, 06:18:05 pm »
Ok, I'm just maneuvering a car.

22
Graphics / Still artifacts
« on: July 06, 2009, 06:05:25 pm »
How do you make this problem occur? Would like to see it in action just for fun :D

23
General / Trigonometry, float or double?
« on: July 06, 2009, 04:22:50 pm »
Which type is the most commonly used when dealing with trigonometry? If I define PI as a float and use the float versions of sin, cos etc. will I get enough precision? I'm using floats atm and it seems enough.

I know the SFML methods take float parameters but my math teachers always said I should use as many decimals as possible while calculating and then round off in the end.

The thing I'm working on is not gonna be sent up in space, I'm just curious :P

24
Graphics / Shape::SetColor issue. SFML Bug?
« on: July 04, 2009, 06:59:28 pm »
You are right, guess the code sample made me focus on the language used instead of the actual "problem". :)

25
Graphics / Shape::SetColor issue. SFML Bug?
« on: July 04, 2009, 02:13:31 pm »
Shouldn't this be moved to the Python section?

26
Graphics / Retrieving correct coordinates
« on: July 03, 2009, 07:29:40 pm »
After reading up on the article again, I think there is another easier (possibly) way to do this. I will investigate further.

27
Graphics / Retrieving correct coordinates
« on: July 03, 2009, 03:23:35 pm »
Hello, let's start off by showing a screenshot.



Above you see my beautiful car with only 3 wheels :). I know I read an article a while back about how to make proper steering for a car. Iirc the car should be rotated around the point circled on the picture above (the intersection point of the left wheels' lines) and not around the center of the car.

In order to do this I need to know two points on each line (for the intersection test I'm using), but I don't know how to retrieve them. First I tried to get the points from the sf::shape::line but I can't use those values directly, I guess because of the way I have structured my code. This is how i do it (this code is only temporary, it looks like s*it I know :)):

Code: [Select]
struct Sub: public sf::Drawable
{
Sub(float _dir = 0): dir(_dir) {}

void Render(sf::RenderTarget& Target) const
{
Target.Draw(subSprite);
Target.Draw(centerDot);
Target.Draw(directionLine);
}

float dir;
sf::Shape centerDot;
sf::Shape directionLine;
sf::Sprite subSprite;
};

struct Base: public sf::Drawable
{
Base(float _dir = 0): dir(_dir) {}

void Render(sf::RenderTarget& Target) const
{
Target.Draw(baseSprite);
Target.Draw(centerDot);
Target.Draw(back);
Target.Draw(frontLeft);
Target.Draw(frontRight);
}

float dir;
Sub back;
Sub frontLeft;
Sub frontRight;
sf::Shape centerDot;
sf::Sprite baseSprite;
;
};


In this case the wheels are of type Sub and the body of type Base. This is how I create the objects (some redundant code here as well):

Code: [Select]
Base base;
base.baseSprite.SetImage(baseImage);
base.SetPosition(400, 300);
base.SetCenter(base.baseSprite.GetSubRect().GetWidth() / 2, base.baseSprite.GetSubRect().GetHeight() / 2);
base.centerDot = sf::Shape::Circle(base.GetCenter().x, base.GetCenter().y, 2, sf::Color::White);

Sub sub;
sub.subSprite.SetImage(subImage);
sub.SetPosition(96, 0);
sub.SetCenter(sub.subSprite.GetSubRect().GetWidth() / 2, sub.subSprite.GetSubRect().GetHeight() / 2);
sub.centerDot = sf::Shape::Circle(sub.GetCenter().x, sub.GetCenter().y, 2, sf::Color::White);
sub.directionLine = sf::Shape::Line(sub.GetCenter().x, sub.GetCenter().y - 200, sub.GetCenter().x, sub.GetCenter().y + 200, 1, sf::Color::Black);

base.frontLeft = sub;

sub.subSprite.SetImage(subImage);
sub.SetPosition(96, 64);
sub.SetCenter(sub.subSprite.GetSubRect().GetWidth() / 2, sub.subSprite.GetSubRect().GetHeight() / 2);
sub.centerDot = sf::Shape::Circle(sub.GetCenter().x, sub.GetCenter().y, 2, sf::Color::White);
sub.directionLine = sf::Shape::Line(sub.GetCenter().x, sub.GetCenter().y - 200, sub.GetCenter().x, sub.GetCenter().y + 200, 1, sf::Color::Black);

base.frontRight = sub;

sub.subSprite.SetImage(subImage);
sub.SetPosition(32, 0);
sub.SetCenter(sub.subSprite.GetSubRect().GetWidth() / 2, sub.subSprite.GetSubRect().GetHeight() / 2);
sub.centerDot = sf::Shape::Circle(sub.GetCenter().x, sub.GetCenter().y, 2, sf::Color::White);
sub.directionLine = sf::Shape::Line(sub.GetCenter().x, sub.GetCenter().y - 200, sub.GetCenter().x, sub.GetCenter().y + 200, 1, sf::Color::Black);

base.back = sub;


I think the problem is that when I retrieve the points for for example
Code: [Select]
base.frontLeft.directionLine
their coordinates are relative to frontLeft (???) and not to the 0,0 coordinate of the window as I would want.

Any help is appreciated. Other ways of doing it are welcome as well (finding two points on each drawn line, if that was unclear :))

EDIT: when I retrieve a point position of a line using
Code: [Select]
directionLine.GetPointPosition(0)
are the point coordinates stored always the inital values? or do they change as the shape is rotated etc.?

EDIT2: the screenshot above is slightly wrong (found the article), the line of the right front wheel should intersect in the same point as the left. But it doesn't change the problem.

28
Graphics / SFML2 crashes on RenderWindow::Draw()
« on: June 29, 2009, 08:15:00 pm »
Talking about old hardware, I found out my crappy intel chipset only supports opengl 1.4, will this be a problem using SFML 2.0?

29
General discussions / Vector2f vs FloatRect
« on: June 25, 2009, 12:11:48 pm »
Quote from: "Avency"
I'd suggest

IntVector2 / FloatVector2 / IntRectangle / FloatRectangle

I think it fits the SFML naming convention most (like RenderTarget, WindowSettings, VideoMode etc.).

The *f and *i seem stange without a number (like 2f).
What are "Rectanglei" and "Rectanglef"?

If you read
Code: [Select]

IntRectangle Rectangle;

you already know that it is a rectangle of integers;

If you read something like
Code: [Select]

Recti Rectangle;
Rectanglei Rectangle;

it would not be that obvious. (I would have to think for a short time if those were simple typedefs or types on their own or whatever...I hope you get what I mean to say.)

Naming the vector typedefs FloatVector2 and IntVector2 would only be consistent. (Even if I like Vector2f, it just doesn't feel right in SFML).

I'd also decide against the short forms "Vec" and "Rect" and go with the full names.

But it's up to you to decide.


Totally agree.

I would stop using SFML if you changed to "Rectanglei" etc. ;) No but seriously I think it looks weird.

30
SFML projects / Squeebs, a 2d comic mmorpg
« on: June 15, 2009, 07:48:42 pm »
Quote from: "efeX"
Yeah. I'm just saying this project used to be in game maker.
I see no SFML in this at all, just HGE and pthread.
This is just a "updater"


Yeah thought about that too.

Pages: 1 [2] 3 4 ... 18
anything