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

Pages: 1 [2] 3
16
SFML website / Re: Old Threads?
« on: April 12, 2012, 07:50:58 am »
Works perfect! Good Job!  ;D

17
SFML website / Re: Old Threads?
« on: April 11, 2012, 04:16:03 pm »
No Problem! I am pleased that I could help! :)

18
SFML website / Re: Old Threads?
« on: April 11, 2012, 10:44:01 am »
Only a few contains a thread number, many more of the search results on google contains only a post number...

Quote
I don't know how to translate them to the new forum URLs.

Can I help u my friend? :P

Its easy, we take the Example URL from before:

http://www.sfml-dev.org/forum-redirect.php?p=47498&sid=ed77845a91be257f561fb40f00eaa6b3

U see, we have one variable for the post Number and one sid that tell us maybe the thread ID of the
old forum, what we need is only the Post number. We get the Post number from the URL and insert
it in a Rediriction to a Link that looks like this:

http://en.sfml-dev.org/forums/index.php?msg=p;

p contains the ID from the Post, in our Example is p = 47498
Then the Link, looks like that:

http://en.sfml-dev.org/forums/index.php?msg=47498;

And the rest makes the Forum Software, it searchs the Thread with the
Message ID 47498 and Show exactly the Place of the Post/Message that u searched for,
on your/our Browser...

If u want I can implement it in your Script...  ;)

With this you can point a Link to the right page on the New Forum, of course, on the french forum too...  :P ;D

19
SFML website / Re: Old Threads?
« on: April 11, 2012, 09:33:30 am »
I would not bother you, but what is done?
It doesn't redirect me directly to the old thread in the new Forum...

I'm using Firefox, but I try it in the IE and in Opera too, it seems
like, that it don't works...

As Example this: Link

Don't redirict me or gives me the Link to the new Forum + the Thread...
Yeah, I Stfu! :-X

20
SFML website / Re: Old Threads?
« on: April 10, 2012, 11:44:49 am »
Mhhh... ok, I understand you, I can wait... But the question is, can the other people wait?
I think its problematic, cause if someone learn to use SFML and has some question, google first
and don't found an working reference, he would make a new Thread or is directly frustrated and
rage quit his life... :P

I don't mean it bad! It's only my opinion.
And I understand that you have not much free time... :)

21
SFML website / Old Threads?
« on: April 10, 2012, 11:25:14 am »
Hello,

I really used Google and the Search Function but I don't found some Threads of the old Forum...
Laurent, is it possible to redirect directly to the new forum + the Topic?

The Links on google are cause of the new forum like dead, all redirect to this site:
http://www.sfml-dev.org/forum-redirect.php
I only want to say this! :)

Lg Orezar

22
Graphics / Re: SFML 2.0 View for Scrolling...
« on: March 27, 2012, 04:25:36 pm »
Ohhh... I understand it know...
I didn't know that the first and second Parameter of the SetViewport Method must given in factors too...

Know it works perfectly!
Thank you for your patience with me... :)

And thanks in general for this nice Libary! :D

23
Graphics / Re: SFML 2.0 View for Scrolling...
« on: March 26, 2012, 08:32:02 pm »
But if I set the Position of the Viewport the sprite is not longer drawed on the Window...


view.SetViewport(sf::FloatRect(400.0, 400.0, ..., ...));     // Sprite is not drawed
view.SetViewport(sf::FloatRect(1.0, 1.0, ..., ...));         // Sprite is not drawed
view.SetViewport(sf::FloatRect(0.0, 1.0, ..., ...));         // Sprite is not drawed
 

In the Documentation ->

 

// Initialize the view to a rectangle located at (100, 100) and with a size of 400x200
view.Reset(sf::FloatRect(100, 100, 400, 200));

// Set its target viewport to be half of the window
view.SetViewport(sf::FloatRect(0.f, 0.f, 0.5f, 1.f));

 

Thats why I thought that by the resetting Method, the first two parameters are the Position of the View
and thats why I think that I'm not doing wrong, but it seems like I do...

The code:


// ... Create Sprite with size (64, 64) ...

// The View
sf::View view;

// Reset it, and set it on the location (400, 400) with the size (64, 64)
view.Reset(sf::FloatRect(400, 400, 64, 64));

// Setting Viewport
view.SetViewport(sf::FloatRect(0.0, 0.0,
sprite.GetGlobalBounds().Width  / App.GetWidth(),
sprite.GetGlobalBounds().Height / App.GetHeight()));

// Setting position after init the View...
sprite.SetPosition(400, 400);

 

24
Graphics / Re: SFML 2.0 View for Scrolling...
« on: March 26, 2012, 05:02:30 pm »
@mateandmetal  Yes, I used it, I only forget it on the Code of the posting before...

@Laurent

Quote
The top-left corner of the view is at (400, 400). Your sprite is at (400, 400). So your sprite is on the top-left corner ;)

No, I don't mean the left corner of the View, I mean that the Sprite is on the Left Corner of the Window... like this:



Do not be suprised, in this Picture I'm using still wrong factors...

With factor I mean the third and forth Parameter of the SetViewport(..., ..., factorX, factorY) Method...
I know now how to calculate the Factor:

factorX = Sprite Width / Window Width
factorY = Sprite Height / Window Height

And it works, nothing is streched...

The only Problem that still exist for me is the Problem with the Position of the View and the Sprite...

25
Graphics / Re: SFML 2.0 View for Scrolling...
« on: March 25, 2012, 04:41:30 pm »
Hey,

first, cool new design of the forum. :)

I looked in the documentation and understand that the 0 and 1 from the Viewport
Function is only a factor, and I've become it stretchless after trying lot of numbers...

But there are still two problems for me...  the first is that the View + the Sprite position is on
the Top Left corner on the Screen, and I really don't understand why, and how to change it...

My Code:

        // ...

        // Setting position of Sprite
        sprite.SetPosition(400, 400);

        // View Object
        sf::View view;

        // Resseting the View
        view.Reset(sf::FloatRect(400, 400, 64, 64));

        // Setting the Viewport
        view.SetViewport(sf::FloatRect(0, 0, 0.1, 0.1));

 

And the other question, is there an way to calculate the Viewport factor? :P

Thanks in advance... :)

26
Graphics / SFML 2.0 View for Scrolling...
« on: March 21, 2012, 09:02:41 pm »
So it is not possible to make a view with a constant View without streching an object?

I'm experimenting with the Function SetViewport(...) from the Class View but I don't understand the functioning, if I use it like this:

Code: [Select]
view.SetViewport(sf::FloatRect(sprite.GetPosition().x, sprite.GetPosition().y, 64, 64)); // 64 = Width and Height of Sprite

I become an wounderfull black screen, if I erase the Positions from the Parameter and set it on Zero, like these:

Code: [Select]
view.SetViewport(sf::FloatRect(0, 0, 64, 64)); // 64 = Width and Height of Sprite

I become an black screen, if I set it like in the Comment of this Function
described on (0, 0, 0.5, 1) I see the Rectangles on screen but a litte bit smaller... what does the values 0.5 and 1 means... Not the size of the Viewport?

27
Graphics / SFML 2.0 View for Scrolling...
« on: March 21, 2012, 07:42:08 pm »
Hey,

my question is, (how) can I use a View for a Button List, with a Scrollbar, to scroll back and forth between these buttons? Is this possible with an View?

I try a little bit out, but the problem is that if I make an Sprite Object on the Position (100, 100) with the Size (64, 64), and a View Object, Reset it on the Values: (100, 100, 64, 64), the whole Screen is filled with the Sprite Object...

Is it possible to make a View with a constant Size without resize the Sprites in her? If I use the Zoom Function the View is resizing or I've missunderstood what?

Because I don't have an Idea how to make it different, the only Idea that I have is to Resize the Objects if the scrollbar is on there Object Position, but this is not really the best solution,
and if I only Draw the Objects in the Area of the scrollbar the other Objects disappear at once without having an transition...

Its a bit hard to explain it in english, but I hope you understood me nevertheless...

Thanks in advance!

28
General discussions / SFML 2.0 Shader - Question
« on: March 18, 2012, 09:36:02 pm »
Omg... how I forgot to say "Thanks"?
Thank you for the help!!  :D

29
General discussions / SFML 2.0 Shader - Question
« on: March 18, 2012, 07:49:45 pm »
Laurent, sometimes I ask myself why there is an Switch behind my brain and a Label "off" next to it... and what it means... :?

30
General discussions / SFML 2.0 Shader - Question
« on: March 18, 2012, 07:19:04 pm »
Hello,

I have some problem with implementing shaders and showing these on the Application Window, I'm loading the Shader with this piece of Code:

Code: [Select]
// The Image Object
sf::Image img;

// Create an Image with the Size of the Window
img.Create(App.GetWidth() + 1, App.GetHeight() + 1);

// The Texture Object
sf::Texture tex;

// Load the Image
tex.LoadFromImage(img);

// The Sprite Object
sf::Sprite sprite;

// Set the Texture
sprite.SetTexture(tex);

// The Shader
sf::Shader sh;

// Load the Shader Files
sh.LoadFromFile("shader.vert", "shader.frag");

// Renderstates Object
sf::RenderStates r;

// Set active Shader
r.Shader = &sh;

   // ...
   App.Draw(sprite, r);


The Vertex Shader looks like this:

Code: [Select]
void main(void)
{
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}


And the Frament Shader looks like this:

Code: [Select]
uniform float time;
//uniform vec2 mouse;
uniform vec2 resolution;

void main(void)
{
const float stars = 512.0;
const float depth = 512.0;
const float skew = 16.0;
float gradient = 0.0;
float speed = 128.0 * time; //negate to reverse

vec2 pos = (((gl_FragCoord.xy / resolution.xy)) - 0.5) * skew;
vec2 pos_center = pos - vec2(0.5);

for (float i = 1.0; i < stars; i++)
{
//i * i will get a typical starfield effect
float x = sin(i) * 256.0;
float y = cos(i) * 256.0;
float z = mod(i - speed, depth);

vec2 blob_coord = vec2(x, y) / z;
float fade = (depth - z) / 512.0;
gradient += ((fade / depth) / pow(length(pos_center - blob_coord), 1.8));
}
float r = abs(sin(time * 1.13));
float g = abs(sin(time * 2.23));
float b = abs(sin(time * 3.33));

gl_FragColor = vec4(gradient * r, gradient * g, gradient * b, 1.0);
}


I tooked the Frament Shader Code from this Site:
http://glsl.heroku.com/e#1885.0

First I thought the Problem is that the Code is for GLSL ES but it seems like the Vertex and Fragment Shader are linked and installed on the GPU sucessfully... and the Problem is that I don't see anything on the Application Window... only a Blackscreen...

I really read all references about GLSL that I found on google, but it seems like that this references all shows the same Shaders as Example that are very complicated and more specially for 3D Stuff and not suitable for beginners.

So I looked for a Site with shaders and found this live Shader Sandbox Site, tooked the Shader and dissassembled the code to understand whats going on, and it works on this Browser Sandbox, but in the SFML Window the Blackscreen stoped me...

I hope you can help me :)
Thanks in advance!

Pages: 1 [2] 3
anything