Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map function call meets error #107

Closed
gaocegege opened this issue Jun 8, 2017 · 3 comments
Closed

map function call meets error #107

gaocegege opened this issue Jun 8, 2017 · 3 comments

Comments

@gaocegege
Copy link
Member

gaocegege commented Jun 8, 2017

# Fails due to mouseX Fails due to bezierDetail()

P3D <- "processing.opengl.PGraphics3D"

settings <- function() {
    processing$size(100, 100, P3D)
}

setup <- function() {
    processing$noFill()
    processing$noLoop()
}

draw <- function() {
    processing$background(204)
    d <- processing$map(processing$mouseX, 0, 100, 1, 20)
    processing$bezierDetail(d)
    processing$bezier(85, 20, 10, 10, 90, 90, 15, 80)
}
org.renjin.eval.EvalException: Instance of class rprocessing.RLangPApplet has no member named 'map'
	at org.renjin.invoke.reflection.ClassBindingImpl.getMemberBinding(ClassBindingImpl.java:175)
	at org.renjin.sexp.ExternalPtr.getMemberBinding(ExternalPtr.java:60)
	at org.renjin.sexp.ExternalPtr.getMember(ExternalPtr.java:64)
	at org.renjin.primitives.special.DollarFunction.fromExternalPtr(DollarFunction.java:115)
	at org.renjin.primitives.special.DollarFunction.apply(DollarFunction.java:71)
	at org.renjin.eval.Context.evaluateCall(Context.java:368)
	at org.renjin.eval.Context.evaluate(Context.java:256)
	at org.renjin.eval.Context.evaluateFunction(Context.java:398)
	at org.renjin.eval.Context.evaluateCall(Context.java:361)
	at org.renjin.eval.Context.evaluate(Context.java:256)
	at org.renjin.primitives.special.AssignLeftFunction.assignLeft(AssignLeftFunction.java:57)
	at org.renjin.primitives.special.AssignLeftFunction.apply(AssignLeftFunction.java:41)
	at org.renjin.eval.Context.evaluateCall(Context.java:368)
	at org.renjin.eval.Context.evaluate(Context.java:256)
	at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:38)
	at org.renjin.eval.Context.evaluateCall(Context.java:368)
	at org.renjin.eval.Context.evaluate(Context.java:256)
	at org.renjin.eval.Context.evaluate(Context.java:197)
	at org.renjin.sexp.Closure.doApply(Closure.java:84)
	at rprocessing.RLangPApplet.draw(Unknown Source)
	at processing.core.PApplet.handleDraw(PApplet.java:2439)
	at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:849)
	at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
	at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
	at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
	at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
	at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
	at java.util.TimerThread.mainLoop(Timer.java:555)
	at java.util.TimerThread.run(Timer.java:505)
@gaocegege
Copy link
Member Author

It may be related with #97

@gaocegege
Copy link
Member Author

settings <- function() {
    size(100, 100, P3D)
}

setup <- function() {
    noFill()
    # noLoop()
}

draw <- function() {
    stdout$print(mouseX)
    background(204)
    d <- map(mouseX, 0, 100, 1, 20)
    bezierDetail(d)
    bezier(85, 20, 10, 10, 90, 90, 15, 80)
}

The issue is solved via #95 and #134

@gaocegege gaocegege modified the milestone: Evaluation 2 Jul 14, 2017
@jeremydouglass
Copy link
Member

It looks like this closed issue was based on the broken examples/reference/bezierDetail/ -- R code that was based on https://processing.org/reference/bezierDetail_.html

Now that it is no longer broken, should your working reference example be added to master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants