how do image points work?

This forum is currently in read-only mode.
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • not how do I implement them, but if I want to get a location

    basically a location I could either get from trigonometric functions

    or by creating a sprite with an imagepoint, rotating it, and getting the imagepoint

    is it quicker to get an imagepoint of a sprite, because of some vram sprite rotation thing?

    or is it just calculating an offset of the sprites hotspot using sin and cosine and such?

  • Um, I don't really understand what you mean, but the GetImagePoint function factors in scaling and rotation for you. Image points aren't stored in VRAM, they're stored in system memory, so the function to retrieve it is fast.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I just mean,

    imagine creating a function to create and retrieve imagepoints

    you would store an x and y offset value, and then on retrieval and then use something like trigonometric functions to calculate the current location of the imagepoint

    I'm trying to find out if that's how they work in construct, or does construct use some kindof special feature of sprites to retrieve the location of the imagepoint pixel or something

    basically to figure out if I would save any time by using actual image points or by using the aforementioned trigonometric functions. in this instance, I would be creating a sprite just for the sake of using the quicker imagepoint retrieval if that was the case. the sprite wouldn't be needed otherwise.

  • You can kind of do that already with distortmaps get vertex x, and y... within the limitations of distormap that is.

  • Construct uses the trig math method. There's no other reasonable way! If you thought the graphics card could do this, just sending the message from the CPU to the GPU instructing it to perform the calculation would take longer than just doing the sum anyway, so I think you're misleading yourself. It can't really be done any other way!

  • I think image points already use trigonometric functions to determine the current image point x and y for a sprite, in its position, with its rotation. There's not other way in the world. And it makes no sense using trigonometric function instead of image points that use them (anyway when I didn't know about image points, I used sin and cos).

  • Genesys: Of course sin and cos are used. Lucid just wanted to know if there counstruct was using some GPU-optimised method with image points, as he wanted to optimise his own code for speed.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)