-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add documentation for p5.Camera properties #5056
Comments
@stalgiag, I think we should have a function( p5.js/test/unit/webgl/p5.Camera.js Line 7 in c1640a7
(The code will of course be different) PS: I would like to work on this. |
Hi @AndrewAung11 you can get these with the let cam;
function setup() {
createCanvas(400, 400, WEBGL);
cam = createCamera();
print(cam.centerX);
} That might be necessary @Aloneduckling . It also might just be an issue of documentation. For example, the reference for p5.Camera doesn't mention the |
Thanks @stalgiag I will try it. |
@stalgiag, So should I go ahead and code the above function? Edit:
|
Hi @Aloneduckling I am not sure that it makes sense to add this function. It would give an object with properties that are already directly accessible on the camera object. I think we should instead just make it more clear in the documentation that these properties exist on the camera object. |
@stalgiag, I agree that adding this function would be overdoing it. Updating the documentation makes more sense. I will update the docs and create a PR. |
@stalgiag, I have added these lines to the p5.Camera documentation. is this ok? |
@Aloneduckling that is very nicely written but it might be better to list the properties with their own entries similar to how it is done with the p5.Image reference. You can see how these are added here. |
I think it still makes sense to add the properties to the |
Ok, I will add the properties separately. |
@stalgiag, I have added some properties please have a look, if this is okay then I will finish with the rest. PS:
This code doesn't seem to be working when centerX/Y/ Z properties are used. So for these examples, I think we should print the values unless there is a way to make them work. |
Great job @Aloneduckling. The way that you are adding documentation looks good. The examples should be read-only. There are methods in place for setting these values that are safer. For example, the centerX, Y, Z docs can show the output for current camera center coordinates when the canvas is being manipulated by |
@stalgiag thanks, I will now create a PR after adding the necessary changes. |
How would this new feature help increase access to p5.js?
Most appropriate sub-area of p5.js?
Feature enhancement details:
Want the code to give info about the camera position. Like
camera.x
,camera.y
andcamera.z
which will really make camera object useful.The text was updated successfully, but these errors were encountered: