Comments (10)
Is it possible to add hot spots (eg. arrows) for chaning sphere texture?
from panorama.
Hotspot support would be great.
from panorama.
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.
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.
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.
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.
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.
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.
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.
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)
- Just detect touch Swift 3 HOT 1
- How do i get same woking of lockPanToHorizon with landscape mode in device HOT 3
- Set Image directly instead of name/path HOT 1
- adapting image orientation with device orientation HOT 2
- How can I set the current viewing direction to the center of the image? HOT 2
- How to Use the Panorama View for UIView? HOT 1
- Camera Features Support HOT 3
- setImage and setImageWithName not working when I try to set it from directory or bundle directory HOT 2
- Large Image not loading. HOT 2
- Tiny planet effect by zooming out HOT 1
- EXC_BAD_ACCESS on iOS 11 HOT 4
- how to set image size for scale 16:9 HOT 1
- Unable to build pod in swift project HOT 2
- Library for Android
- iOS black screen HOT 1
- Control Zooming
- Its not working on iOS
- Migrate to Swift and Metal?
- How to use pitch and yaw to place hotspots ?
- Port to Swift/Metal is available: dhoerl/Panorama
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panorama.