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

Pages: [1]
1
Hello guys and girls!

I am new to programming and I have a faculty assignment that involves using SFML.

To be precise, it involves drawing a shape defined by 2 math functions and then performing certain operations (translation, rotation...etc).

Part of the shape is defined by points which have negative x and y coordinates.

From what I understood, SFML coordinate system has its origin (0,0) in the top left corner of the screen while max coordinates are defined by the window size.

I am puzzled on how I can plot these points with negative coordinates in SFML. I have read an article about SF view coordinates which have an inverted x axis so I thought about faking the whole construction by creating a coordinate system within a coordinate system...but I am not sure whether this will help in the long run.

One of the tasks in the project is to do a mirroring projection over the x axis and since the x axis is basically the top border of the screen, I am not sure how to transfer a point - for example a point with coordinates (x=5,y=1) would become (x=5,y=-1) in normal circumstances.

Am I overlooking something being inexperienced as I am?

I am really looking forward to digging deeper into this and I love SFML as it is my first tool that allowed me to play with animations.

Below, I have attached the shape. as you can see, part of the shape is in the negative values of x & y so I am not sure how to do it. If i create another coordinate system (not sure how this "work around" will perform), i am limited as a non-expected input from the user (when it comes to entering a translation vector) could mess the whole construction.

Many thanks!

Addendum: I have constructed the object by pretending the middle of the screen is the middle of the coordinate system( window size 1000,1000 puts the middle at 500,500). Works fine so far, will have to go through every possibility in the assignment to see if this will the the long term solution.
Of course, I would still love to hear any ideas or advice!

2
Graphics / Re: Drawing a hyperbola in SFML
« on: January 08, 2021, 02:42:13 pm »
Thanks for your time and for you help!

This brings a lot of clarity now.

Have a good one.


3
Graphics / Drawing a hyperbola in SFML
« on: January 05, 2021, 05:45:24 pm »
Hello guys and girls!

New to programming and new to SFML. I have watched couple of videos on Youtube and have gone through most of the tutorials on site.

Is there a way to draw a hyperbola shape in SFML? The only alternative I see at the moment is making something that just resembles hyperbola with convex shapes by plotting multiple points which would make out a "curve" out of straight lines.

Many thanks for any help!

Pages: [1]