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

examples: Add a 3d example #46

Merged
merged 1 commit into from
May 11, 2017
Merged

examples: Add a 3d example #46

merged 1 commit into from
May 11, 2017

Conversation

gaocegege
Copy link
Member

@gaocegege gaocegege commented May 11, 2017

demo

Signed-off-by: Ce Gao ce.gao@outlook.com

Signed-off-by: Ce Gao <ce.gao@outlook.com>
@gaocegege gaocegege merged commit a5a51a9 into master May 11, 2017
@gaocegege gaocegege deleted the example/3d branch May 11, 2017 10:23
Copy link
Member

@jeremydouglass jeremydouglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is a really compelling visual demo -- I can see why you are using a gif of it to feature the project on the homepage and elsewhere.

Is this cube animation inspired by a sketch from somewhere else?

@@ -214,8 +214,9 @@ protected void wrapProcessingVariables() {
this.renjinEngine.put("displayHeight", displayHeight);
this.renjinEngine.put("focused", focused);
this.renjinEngine.put("keyPressed", keyPressed);
this.renjinEngine.put("frameCount", frameCount);
this.renjinEngine.put("frameCount", (double) frameCount);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cast-to-double issue occurs frequently throughout the code -- Processing Java developers are used to using floats for everything, so it is worth adding a note in the Wiki about why it is necessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, actually I'm trying to find another way to solve the problem. For example do casts from float to double in the language level by renjin. It will reduce the manual work in BuiltinApplet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Maybe open an issue for this (Approaches to float-double casting) if there isn't one already.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion! I will file one now.

public void box(double w, double h, double d) {
super.box((float) w, (float) h, (float) d);
}

// TODO: Blocked until pre-processor.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good documentation of ongoing issues. Color issues you encounter in this project will often take two broad forms:

  1. the color data type in processing is actually pre-processor sugar for an int
  2. specifics of the way colors are handled at a low level using ARGB bit-math, vs. control of how colors are specified or retrieved using colorMode().

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

Successfully merging this pull request may close these issues.

None yet

2 participants