Comments (6)
Here's my workaround.
@interface SCNNode (Damn)
- (void)changeMaterial;
@end
@implementation SCNNode (Damn)
- (void)changeMaterial
{
NSLog(@"changeMaterial sent to instance of %@",[self class]);
}
@end
from arkit-by-example.
I don't understand your workaround. May you elaborate ? Thanks !
from arkit-by-example.
Some instance of SCNNode is being sent the message changeMaterial that does not implement changeMaterial. Only the subclass Cube implements changeMaterial but the code sending the message isn't checking that the node it is sending changeMaterial is a Cube (or better - respondsToSelector:@selector(changeMaterial)).
So I added a category to SCNNode called changeMaterial that simply logs the message. It is overridden by the method in Cube. So now it is no longer an "error" to send changeMaterial to any SCNNode.
from arkit-by-example.
The problem is that with your solution the user has to click several times on the plane in order to be able to change its material. He has to click until the correct instance (Plane) is returned. This is not satisfying. I don't understand why the plane is not detected reliably when I click on it.
from arkit-by-example.
from arkit-by-example.
If it's not a Cube, check if it's a Plane then call changeMaterial
.......
if ([parentNode isKindOfClass:[Cube class]]) {
[((Cube *)parentNode) changeMaterial];
} else if ([parentNode isKindOfClass:[Plane class]]) {
[((Plane *)parentNode) changeMaterial];
}
I think the hit detection problem is that before hitting a Plane it can hit a feature point
from arkit-by-example.
Related Issues (9)
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 arkit-by-example.