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 - Cory Parsnipson

Pages: [1]
1
Graphics / Re: Get translate/scale/rotation from sf::Transform?
« on: April 21, 2016, 08:26:17 pm »
Ok I see. Thanks for your help!

2
Graphics / Re: Get translate/scale/rotation from sf::Transform?
« on: April 21, 2016, 04:32:28 am »
Ah you're right, my bad. I take it from your response, though, that that if you have an object that is not transformable but has sf::Transform as a member, you cannot obtain a separate transform component from it.

3
Graphics / Re: Get translate/scale/rotation from sf::Transform?
« on: April 19, 2016, 12:51:53 am »
I'm not sure what you mean by "specific matrix", but I'll describe the situation that made me think of this question.

I have a class that contains an sf::View and I want to allow users to modify it through scaling, translation, rotating, etc. I also want this class to have member functions for getting the transform such as "get_scale" or "get_position" etc. I could keep separate variables that keep track of scale and positioning and stuff alongside the raw transform, but I thought it would be nicer if I could just obtain it from the sf::Transform object inside the sf::View.

EDIT: I just realized that the sf::View transform is the "projection transform" and for internal use only? Regardless, my question still applies for other objects like sf::Transformables, Sprites, etc.

4
Graphics / [Answered] Get translate/scale/rotation from sf::Transform?
« on: April 18, 2016, 11:26:39 am »
The documentation does not seem to have anything about getting individual transform values from an sf::Transform struct. Is it possible, given an sf::Transform to isolate a single "attribute" from it? For example, if I wanted to know what the scaling of a specific transform was, is there anything I could do?

Also, it seems like you can get the raw 3x3 matrix. Is there any reading I can do for how to manipulate these matrices?

Thanks.

5
Graphics / Re: SceneGraph + Layers Concept
« on: April 10, 2016, 04:02:32 am »
Whoa, cool. This is really informative. Thanks!

6
Graphics / Re: SceneGraph + Layers Concept
« on: April 09, 2016, 05:26:31 am »
Thanks for the example! Do you ever run into a situation where you want a single node to be in multiple layers?

For example, let's say you have a house or something where you want the back wall to be behind the player character, but the front wall to block it. Do you make two separate nodes for these items?

7
Graphics / Re: SceneGraph + Layers Concept
« on: April 08, 2016, 08:58:08 pm »
Also I forgot to add that most likely there will be maybe 3 -5 layers at any given point, so there shouldn't be very many render textures being generated, if that makes a difference.

8
Graphics / SceneGraph + Layers Concept
« on: April 08, 2016, 08:38:35 pm »
Hi, I'm thinking about implementing a scene graph with layers capability. I'm planning on making the scene graph as a general tree with a draw method that descends the prefix and draws everything to the render window (eventually).

I'm trying to figure out how to implement layers while still doing this traversal and I've decided on having 1 sf::RenderTexture per layer with each node in the scene graph having a integer to identify which layer they are on. So while I'm traversing the scene graph, instead of drawing every node directly to the render window, I query it's layer "z-index" and then draw it to the right render texture.

Lastly, when I update the render window, right before I display it to the screen, I'm going to iterate in order of z-index and draw all the render textures to the render window.

Whew, so my question actually is this: Will using Render Textures as an intermediate step really, really slow down my game loop? I'm not sure of the implementation details at this point so I'm also concerned that I'll be swapping the OpenGL context too often with no way of adding in a sprite batch capability later.

Also, if there is a better conceptual way or something in the docs that already implements this stuff, I'd totally be open to learning about it...

Thanks!

Pages: [1]