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

Pages: 1 [2] 3 4 ... 12
16
DotNet / Bug with line drawing? Shouldn't it go from p1 to p2? (easy)
« on: February 01, 2009, 07:22:20 pm »
Quote from: "sofakng"
Darn floats.  They always cause problems! :)

The reason I found this bug was because I'm trying to draw isometric tiles using the SFML drawing functions but the sides of the tile do not line-up correctly.  I guess it's a little confusing because OpenGL and Flash both seem to render the lines "correctly" (but I suppose correct is a relative term).

I might be able to use pre-generated sprites so my lines are always correct but I was hoping to use the drawing functions for other purposes as well.


You should always be allowing a pixel or so of overlap in your displays to prevent these "texture seams."  Remember OpenGL or any 3D API correctly uses floats, so you have to expect and prepare for rounding variance.
You can possibly ignore this if everything you draw is axis-aligned and you always force it to the int value you want (with checks to make sure it rounds the correct way), but this will never be the case with "isometric" tiles.  Either way, just having all your terrain textures (or any textures that are supposed to touch and match up) overlap by 1 pixel will fix all these issues.

17
General discussions / SFML 2.0
« on: January 30, 2009, 08:21:27 pm »
Quote from: "Laurent"
Yes, I'm interested. Can you send me your implementation?


Yeah, as soon as they let me out of my engineer's <strike>cell</strike> cube and I get home.  :p

18
General discussions / SFML 2.0
« on: January 30, 2009, 04:06:41 pm »
I've already added stuff for render masks, if your interested.  I implemented them using the TextureCombiners extension.  (Should be supported pretty much everywhere and avoids issues with requiring main-memory images data, excessive computation, etc.)

Edit:  It would be possible to add a rollback if TextureCombiners is not supported, but I imagine the set of machines that don't support TextureCombiners, but would have enough CPU to calculate this stuff the hard way each frame would be very small.

Edit Edit:  Unless you just want to do everything at load time, but that would make the interface awkward and limit run-time features.

19
Graphics / Rounded Rectangles
« on: January 28, 2009, 10:57:27 pm »
Use an image.  (You could have a small "round corner" image that you pair with straight line images as necessary.)
You could also do some stuff with alpha masks and texture combiners / shaders, but if you don't know about that stuff, piecing together the rectangles HTML-style for rounded corners should work.
Making a shape primitive with enough segments to appear round is probably not very efficient.

20
Graphics / Re: Loading OpenGL texture using SFML
« on: January 27, 2009, 10:21:29 pm »
Quote from: "XenonTRX"
Hi, everyone

I'm a program which uses SFML for making a window, event handling etc., and OpenGL for rendering (3D).


That's some impressive AI.  Are you self-aware?  Who made you?  What is your purpose?  What are your feelings on Sarah Connor?

21
General / Add files to SFML
« on: January 26, 2009, 04:01:28 pm »
Quote from: "cpl"
Quote from: "Laurent"
You should really not do this. Just create your own library.


Yeah, I might do that if things starts to mess up. However this works pretty well right now and I think I'm gonna keep it this way (for now).


When it stops working, you're going to have no idea why and get cryptic linker errors or erratic behavior.  Seriously.  Don't do this.  You don't really gain anything by stomping on SFML namespace anyway.

22
Graphics / Strange Blurring
« on: January 21, 2009, 09:01:19 pm »
Quote from: "Odysseus"
Ok, thanks.

It still seems odd to me that it gets stretched even though it hasn't been moved or scaled or rotated or anything.  Why is that?


Because OpenGL is autmatically using sub-pixel interpolation to place your sprite.  (Remember positions are in floats).  This makes movement look smoother, but you may want to round your sprite positions the the nearest whole number when they stop.  Alternately, just disable the smoothing completely as Laurent showed.

23
Graphics / Draw directly into an image
« on: January 17, 2009, 04:50:30 pm »
You just have to modulate the drawable's color to be brighter when the mouse is over it.

24
General / Visual C++ Questions
« on: January 17, 2009, 04:47:35 pm »
I think SFML only supports 8-bit .png files

25
General discussions / German forum
« on: January 17, 2009, 04:45:25 pm »
I am opposed to any further fragmentation of the SFML userbase.  But obviously, you can make whatever forum you want.

26
Graphics / Sprite::GetPosition()
« on: January 06, 2009, 08:18:57 pm »
Quote from: "ravenheart"
ok ill try to explain

i have two sprites that should go in circles
center of the rotation is the midle of the screen
i need the distance between the two sprites'

when i set the center of rotation = middle of screen, getposition will not return different values for both sprites

am i right?


Yes, you are right.  GetPosition will return the same value since you're not actually moving them.  The reason is that you're misusing rotation to attempt to set the rendered position as well.  If you want rotational movement about a center point, you should calculate the new position yourself and set that position.

27
General / pseudo 3D rotation help
« on: November 21, 2008, 02:38:47 am »
You need to track the vertices as internal 3D and transform them to 2D for rendering.

28
Window / App keeps crashing before or while creating the window?
« on: October 19, 2008, 02:30:19 am »
Are you linking the correct librarties?  (debug / release?)

29
General / Loading the Image in a class?
« on: October 19, 2008, 02:23:34 am »
Have you debugged and traced through the code?  Are the images sucessfully loading?  Are you actually drawing the sprites?  Trace through and find the section that's not working and then ask specifically about that if you still can't figure it out.  "Here's all my code why doesn't it work?" posts are hard to answer.
Edit:  It looks like you have error-checking code for loading, so I'd look at wheer you're drawing.

Edit:  Also, iterating through every image everytime you want to draw one is terrible.  Like really, really slow.  What are you actually trying to achieve with this class?

30
Graphics / My problem with frame time and it's blurriness...
« on: October 11, 2008, 04:42:37 am »
You're missing the point.  You internally track the position of the object as normal.  You don't round that.  If you do, you're obviously going to change the movement speed calculations.
Just round the position right before rendering then change it back.  You don't even need another class variable.  Just do it in-line in the render code.  Temp save the real value, wright the rounded value, render, write-back the real value.

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