Giter VIP home page Giter VIP logo

Comments (10)

paweljankowski avatar paweljankowski commented on July 30, 2024

Is it possible to add hot spots (eg. arrows) for chaning sphere texture?

from panorama.

ivoheckmann avatar ivoheckmann commented on July 30, 2024

Hotspot support would be great.

from panorama.

mayakraft avatar mayakraft commented on July 30, 2024

thanks guys! if I'm reading correctly, you are talking about hotspot on the screen, not hotspot in the 3D environment, correct? the latter, which is much harder, i'm working on right now, maybe finish inside of a month.

RE screen hotspot: consider PanoramaView as a kind of a UIImageView class, one could add a UIButton on top of it in the view hierarchy, and it intercepts touches just fine. So you can do all this in ViewController without touching PanoramaView. Here's what i just tried in ViewDidLoad right after [self setView:panoramaView]:

    float buttonSize = 88.0f;
    UIButton *hotspot = [[UIButton alloc] initWithFrame:CGRectMake(self.view.bounds.size.width*.5-buttonSize*.5, self.view.bounds.size.height-buttonSize, buttonSize, buttonSize)];
    [hotspot addTarget:self action:@selector(changeImage:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:hotspot];

and then added this function below:

-(void) changeImage:(UIButton*)sender{
    NSLog(@"change Image");
    [panoramaView setTexture:@"newImage.png"];
}

Does this work in the context of your code?

from panorama.

ivoheckmann avatar ivoheckmann commented on July 30, 2024

Hi @robbykraft,

thanks for your answer (and for the great code of course). I was talking about hotspots in the 3d env. - but cool to hear your are working on it. I can imagine the it's not that simple - thinking of touch detection and trigger actions.

from panorama.

kazzar avatar kazzar commented on July 30, 2024

Grate work @robbykraft , unfortunately my english is very bad :P
There is a way to get image coordinate during pan gesture? i want to try to intercept when 1 frame is displayed and show a button like you have suggest

from panorama.

mayakraft avatar mayakraft commented on July 30, 2024

hi all, check the latest commit, the touchVector is calculated as it should. how does this suffice for hotspots?
i still need to precision test the getPixel function, and the graphical line indicators that are triggered by a tapGesture. they do seem to be in the right place.

from panorama.

ivoheckmann avatar ivoheckmann commented on July 30, 2024

Hi @robbykraft ...thanks again for your work. Talking of hotspots for me the first question is how to add touchable hotsport views in the environment, the second one how to trigger actions (wich i guess can be done via the commits you have done).

from panorama.

mayakraft avatar mayakraft commented on July 30, 2024

thanks for the reply! that makes sense. lemme know if this function helps out:
-(bool)touchInRect:(CGRect)
sorry if i closed this too early!

from panorama.

phantomlight avatar phantomlight commented on July 30, 2024

Hello robbykraft thank you so much for this! works great in my app. I'm trying to get hotspots to work. Not sure if anyone was able to get it working. Pretty much added a button and when the button is pressed depending on the coordinates set should change the view inside the image. Any idea?

from panorama.

mayakraft avatar mayakraft commented on July 30, 2024

hello @phantomlight
did you try this function:

/**
 * Hit-detection for all active touches
 *
 * @param CGRect defined in image pixel coordinates
 * @return YES if touch is inside CGRect, NO otherwise
 */
-(BOOL) touchInRect:(CGRect)rect;

This adds a button into the world. This is the function that people are calling a "hotspot". It moves with the panorama.

Adding a UIKit UIButton will not move around with the world, but sit in the same location on the screen.

Can you clarify again what you're trying to accomplish?

from panorama.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.