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

Pages: 1 ... 5 6 [7] 8 9
91
General / Rotation Formula
« on: August 07, 2011, 11:39:46 pm »
Thx for taking the time to make that example. I tried it and it worked fine, i have not tried yet to implement it into my code but i will soon. I just have a question first.

Code: [Select]
float BodyAngle = Rect.GetRotation() * PI / 180;
        Rect2.SetX(Rect.TransformToGlobal(Rect.GetCenter()).x + (sin(BodyAngle) * 80));
        Rect2.SetY(Rect.TransformToGlobal(Rect.GetCenter()).y + (cos(BodyAngle) * 80));


That part, what are you doing there? I haven't learned about sin, cos yet but i will try to now. I understand that you are converting the rotation degrees to something else. Would you mind trying to explain to me what's happening here exactly? thx again for the help :).

92
General / Rotation Formula
« on: August 07, 2011, 07:30:00 pm »
Hi. I have been trying for many hours to get this to work.
I want to rotate a door together with a room, so it stays on the same wall when the room rotates. I did try to set center of the door on the same location as setcenter of the room is (middle), and that worked. But then the doors x and y will be missplaced.

I would like to know of a formula that can rotate the door around a point based on what angle the room has. I have only done Math A and B so i'm no math proffessor, maybe someone else is and can help me by explaining it well? :).
Thx

93
General / Anyone need automatisation for putting sprites in 1 file?
« on: April 15, 2010, 06:12:29 pm »
Quote from: "bullno1"
I use graphic gale for sprites:
http://www.humanbalance.net/gale/us/

The free version of this tool is good enough.
It has onion skin support so you don't really have to worry much about wrong character placement between frames.

I also use this and paint.NET together to reformat ripped sprites from classic games as most ripped sprites are not properly aligned to be used in game.

I checked it out. very nice, i should have asked here before i started to make this ^^.

94
General / Anyone need automatisation for putting sprites in 1 file?
« on: April 15, 2010, 04:40:57 am »
Hi. I was exporting a 3d character to png files. 26 frames in 8 directions so 208 images that i needed to put in 1 image file. I sat for hours and hours with it, every image needs to be on the exact correct pixel, or the character will seem to change position when updating frame. And i thought that i don't wanna do this for every animation i create, for 8 different directions, so i am making a program that is automating this process. You just need to enter a few values and everything is handled automatically. The images don't need to be the correct size from the start or anything.

Anyway is anyone else annoyed with this and want the program? (it's for paint.net only)


Edit: I should probably have posted this in general discussions.

95
Graphics / SetScale in 1.6 displaces the graphics
« on: April 10, 2010, 08:53:38 pm »
Quote from: "Laurent"
Quote
Ok, can't you just update the 1.6 version with the fix or something?

I would have to make a new release with a new version number. It's not that easy, actually.
I'm currently thinking about releasing SFML 2.0 "soon", a lot of planned features can be added in a future minor release of SFML 2.


I thought i edited that comment and wrote 1.61 ^^. Well i will revert back to 1.5 until sfml 2 is out then.

96
Graphics / SetScale in 1.6 displaces the graphics
« on: April 10, 2010, 03:57:52 am »
Ok, can't you just update the 1.6 version with the fix or something? I will most likely go back to 1.5 if this isn't fixed, since my character is scaling all the time and i notice that it's scaling in a wrong way in 1.6.

97
Graphics / SetScale in 1.6 displaces the graphics
« on: April 09, 2010, 05:39:39 pm »
How will i know when this is fixed?

98
Graphics / SFML 1.6 graphic bug
« on: April 08, 2010, 06:56:21 pm »
Ok i tested a bit more and it turns out that the problem was on my side, i hadn't replaced the dll files in the project directory, by doing that i didn't have any problem anymore, now the only problem i have is with the scaling, as everyone else ^^.

99
Graphics / SFML 1.6 graphic bug
« on: April 08, 2010, 03:50:49 pm »
[img]Yesterday i installed SFML 1.6, and it worked fine. Today it also worked, then i added a few lines of code, and i would get a graphic bug that i will show you in a screenshot. I undo'd all the lines, so it's the exact same code as before, although the graphic problem is still happening, it's not happening on the compiled files i made from yesterday though. Here are screenshots:

(there should be many things on this screen):
http://img169.imageshack.us/i/sfml162.png/

http://img39.imageshack.us/i/sfml16.png/


The lines of code i added were only to set position of some icons, and i reverted everything so..

100
Graphics / 3d character
« on: March 30, 2010, 04:01:54 pm »
Quote from: "spacechase0"
The full SDK has an OpenGL sample which draws a rotating 3D cube. You could probably borrow code from that, and load the 3D model (I don't know how) and make/find a function to draw it (the uses SFML).

As for animating, I don't know. :P You might try storing the current animation to show (and current "frame"), and then adding a few if statements to check what animation/stage your on. I'm not sure if this works the same in 3D though, so you might want to look on Google (and/or wait for more replies) on how to do that.


Yes i might do that, but then i will need to animate walk cycle for every movement direction etc, the best thing would be if it's possible to use a 3d character, and then rotate it etc. Anyone knows if this is possible?

101
Graphics / 3d character
« on: March 29, 2010, 10:44:44 pm »
Is it possible to add a 3d character to sfml? If so, how? Also if this is possible. Where would i animate a 3d object? Anime studio works for this, or does 3ds max work?

Edit: Also it's probably worth mentioning that i want only the character in 3d, since i tried now to make the opengl test cube, and it worked in a new project, but not in the one that i have other sprites in.

102
Graphics / Not showing everything on some computers
« on: March 26, 2010, 02:03:43 am »
ok thanks. Do i need to change much to use it, or is it similar?

103
Graphics / Not showing everything on some computers
« on: March 25, 2010, 11:04:49 pm »
i can post how i draw things, but most of that shouldn't matter much for what is happening on one computer right? Maybe something in the window settings though?

Code: [Select]
sf::WindowSettings Settings;
Settings.DepthBits         = 24; // Request a 24 bits depth buffer
Settings.StencilBits       = 8;  // Request a 8 bits stencil buffer
Settings.AntialiasingLevel = 0;  // Request 2 levels of antialiasing

//Create the Window
sf::RenderWindow App(sf::VideoMode(1280, 1024, 32), "SFML Game", sf::Style::Fullscreen, Settings);

//Vertical sync
App.UseVerticalSync(true);

//Load Images
sf::Image Image[8];

//smoothing
for (int i=0; i<8; i++){
Image[i].SetSmooth(true);
}

if (!Image[0].LoadFromFile("Background.png"))
    return 0;
sf::Sprite Background;
Background.SetImage(Image[0]);

if (!Image[1].LoadFromFile("InventoryBag.png"))
    return 0;
sf::Sprite InventoryBag;
InventoryBag.SetImage(Image[1]);

if (!Image[2].LoadFromFile("Character.png"))
    return 0;
sf::Sprite Character;
Character.SetImage(Image[2]);

//Change this
int numberOfIcons = 16;
if (!Image[3].LoadFromFile("InventoryIcons.png"))
    return 0;
sf::Sprite InventoryIcon[numberOfIcons];
for (int i = 0; i<numberOfIcons; i++){
InventoryIcon[i].SetImage(Image[3]);
}

if (!Image[4].LoadFromFile("WorldIcons.png"))
    return 0;
sf::Sprite WorldIcon[numberOfIcons];
for (int i = 0; i<numberOfIcons; i++){
WorldIcon[i].SetImage(Image[4]);
}

if (!Image[5].LoadFromFile("Tree.png"))
    return 0;
sf::Sprite Tree[11];
for (int i = 0; i<11; i++){
Tree[i].SetImage(Image[5]);
}

int numberOfTrees = 11;
if (!Image[6].LoadFromFile("Tree shadow.png"))
    return 0;
sf::Sprite TreeShadow[numberOfTrees];
for (int i = 0; i<numberOfTrees; i++){
TreeShadow[i].SetImage(Image[6]);
}

if (!Image[7].LoadFromFile("Cursor.png"))
    return 0;
sf::Sprite Cursor[2];
Cursor[0].SetImage(Image[7]);
Cursor[1].SetImage(Image[7]);
Cursor[0].SetSubRect(sf::IntRect(0,0,18,24));
Cursor[1].SetSubRect(sf::IntRect(18,0,49,24));
App.ShowMouseCursor(false);




//Background
App.Draw(Background);

for (int i=numberOfTrees - 1; i>=0; i--){
    App.Draw(TreeShadow[i]);
if (character.y >= Tree[i].GetPosition().y)
    App.Draw(Tree[i]);
}
//Draw icons in the world
for(int i=0; i<numberOfIcons; i++){
if (worldIcon[i].pickedUp == false && character.y >= WorldIcon[i].GetPosition().y + WorldIcon[i].GetSize().y)
    App.Draw(WorldIcon[i]);
}


//Character
App.Draw(Character);


for (int i=numberOfTrees - 1; i>=0; i--){
if (character.y < Tree[i].GetPosition().y)
    App.Draw(Tree[i]);
}
//Draw icons in the world
for(int i=0; i<numberOfIcons; i++){
if (worldIcon[i].pickedUp == false && character.y < WorldIcon[i].GetPosition().y + WorldIcon[i].GetSize().y)
    App.Draw(WorldIcon[i]);
}


if (inventory == true){
    //Inventory
    App.Draw(InventoryBag);
    //Icons in slots
    for (int i = 0; i<16; i++){
        if (slot[i].itemNumber != -1)
                App.Draw(InventoryIcon[slot[i].itemNumber]);
    }
//Draw Icon Text
if (slotMousePos != -1 && slot[slotMousePos].itemNumber != -1)
App.Draw(inventoryIcon[slot[slotMousePos].itemNumber].text);
}

//Icons on mouse
if (itemOnMouse != -1)
App.Draw(InventoryIcon[itemOnMouse]);

if (worldIconMousePos == -1 && inventoryIconMousePos == -1)
App.Draw(Cursor[0]);
else
App.Draw(Cursor[1]);

104
Graphics / Not showing everything on some computers
« on: March 25, 2010, 05:37:17 pm »
This is how it should look, and looks on my computer:


This is how it looks for another guy who tested it:


Any idea what is causing it?

105
Graphics / blurry edges
« on: March 21, 2010, 01:14:03 pm »
Ok this is very weird. I no longer get this issue. in older builds i still get it, although i no longer have the source code of these builds. It's just very weird because i haven't changed anything that should have anything to do with the issue. I have been adding some trees, and that's mostly it..

edit: hah. stripped the code alot and still no problem, so i started checking settings. I had changed anti-aliasing from 2 to 0, and that was my problem, so i don't know what you are all going on about pixels matching etc ^^.

To clarify. 2 aa was bad, 0 is good.

Pages: 1 ... 5 6 [7] 8 9
anything