Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ce Gao <ce.gao@outlook.com>
- Loading branch information
Showing
4 changed files
with
15 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
# point 2 https://processing.org/reference/point_.html | ||
|
||
P3D <- "processing.opengl.PGraphics3D" | ||
processing$size(100, 100, P3D) | ||
processing$noSmooth() | ||
processing$point(30, 20, -50) | ||
processing$point(85, 20, -50) | ||
processing$point(85, 75, -50) | ||
processing$point(30, 75, -50) | ||
settings <- function() { | ||
processing$size(100, 100, P3D) | ||
} | ||
|
||
draw <- function() { | ||
processing$noSmooth() | ||
processing$point(30, 20, -50) | ||
processing$point(85, 20, -50) | ||
processing$point(85, 75, -50) | ||
processing$point(30, 75, -50) | ||
} |
b825b5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these
as.integer()
casts temporary -- will they be removed once CHORD PIE etc. constants #49 and built-in variables #98 are supported?b825b5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice that you changed point2.rpde from immediate mode by adding a settings() and draw() function.
The original simple reference sketch was written in immediate mode (https://processing.org/reference/point_.html).
Is P3D not currently working in immediate mode?
b825b5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re b825b5c#commitcomment-22418715
Yeah, I think so.
re b825b5c#commitcomment-22418768
P3D works well, but size doesn't works since we don't have preprocessor to re-assemble the code #39
b825b5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it about size -- thanks.
Re: as.integer() b825b5c#commitcomment-22418715 :
I'd recommend always putting temporary casts, temporary definitions of constants, temporary definitions of graphics modes, and other placeholders in the header in order to leave the body of sketches as clean as possible in demos, tests, and reference sketches.
So, we don't do this:
...but instead do this:
And we don't do this:
...but instead do this:
Later the top lines can be deleted -- once the variable is defined by the mode.
b825b5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it makes sense!