Thank you, I'm very glad you're enjoying them. Honestly, the channel is already doing better than I would have expected - but who knows, maybe it will take off. I've already recorded the rest of the project, just need to do a little more editing. I'll post the videos in a couple of days.
I am trying to do this project and I am retaking a look at all the 3 videos, but I have a problem with the zoom, in fact I can zoom in but the zoom out simply doesn't work. Here's the code and thanks for the help: int cellScale = 4; int mapWidth, mapHeight; int gridWidth, gridHeight; map theMap; float zoom, cameraX, cameraY; void setup(){ size(800,800,P3D); mapWidth = 1*width; mapHeight = 1*height; gridWidth = mapWidth/cellScale; gridHeight = mapHeight/cellScale; theMap = new map(); cameraX = width/2.0; cameraY = height/2.0; zoom = (height/2.0) / tan(PI*30.0/180.0);
That's very odd. I just pasted your code into a new project and it worked fine. I would try printing the value of e inside the mouseWheel() function. It should be positive when you zoom out and negative when you zoom in. Possibly your scroll wheel returns different values(?) Although using the scroll wheel is nice, you could always replace it with keys, e.g. when i is pressed add 10 to zoom and when k is pressed subtract 10.
@@programmingchaos8957 Thank you for the advice, I tried changing the zoom values with other keys, but everytime I try to zoom out it doesn't work. It could also be for a my computer problem or maybe it's a bug with processing. I try to reinstall Processing and hope. Thanks for your time and help! 👍
@@programmingchaos8957 I have finally fixed it! The problem was that I didn't remember to put background(0) in the main code 😂😅. Tysm for the help and the availability
discovering your channel made my friday night! cheers from Argentina!
I'm glad you're enjoying it! And it's always fun to get contacted by people from around the world. Let me know if any thing cool evolves :)
I've been watching a lot of this stuff lately and this is just what I was looking for, thanks!
I'm glad you found it then. I'll have the other videos in the series posted in a couple of days.
I love your videos content, and I really hope for your 'BOOM' on RUclips. Also I would love to see how this project goes on
Thank you, I'm very glad you're enjoying them. Honestly, the channel is already doing better than I would have expected - but who knows, maybe it will take off. I've already recorded the rest of the project, just need to do a little more editing. I'll post the videos in a couple of days.
@@programmingchaos8957 I'm dying of curiosity as to how this magnificent and exciting project will continue👍
Great video. I'm looking forward to the next installment...
Thanks! The other videos are recorded and mostly edited. I'll post them in a day or two.
super interesting! Subscribed
Fantastic to hear it! I hope you like the rest of the series as well.
Awesome video!
Thanks! I'll post the next two in the next couple of days.
I am trying to do this project and I am retaking a look at all the 3 videos, but I have a problem with the zoom, in fact I can zoom in but the zoom out simply doesn't work. Here's the code and thanks for the help:
int cellScale = 4;
int mapWidth, mapHeight;
int gridWidth, gridHeight;
map theMap;
float zoom, cameraX, cameraY;
void setup(){
size(800,800,P3D);
mapWidth = 1*width;
mapHeight = 1*height;
gridWidth = mapWidth/cellScale;
gridHeight = mapHeight/cellScale;
theMap = new map();
cameraX = width/2.0;
cameraY = height/2.0;
zoom = (height/2.0) / tan(PI*30.0/180.0);
}
void draw(){
theMap.display();
keyInput();
}
void keyInput(){
if(keyPressed){
if(keyCode == LEFT){
cameraX-=5;
}
if(keyCode == RIGHT){
cameraX+=5;
}
if(keyCode == UP){
cameraY-=5;
}
if(keyCode == DOWN){
cameraY+=5;
}
camera(cameraX, cameraY, zoom,
cameraX, cameraY, 0,
0,1,0);
}
}
void mouseWheel(MouseEvent event){
float e = event.getCount();
zoom += 10*e;
camera(cameraX, cameraY, zoom,
cameraX, cameraY, 0,
0,1,0);
}
That's very odd. I just pasted your code into a new project and it worked fine. I would try printing the value of e inside the mouseWheel() function. It should be positive when you zoom out and negative when you zoom in. Possibly your scroll wheel returns different values(?) Although using the scroll wheel is nice, you could always replace it with keys, e.g. when i is pressed add 10 to zoom and when k is pressed subtract 10.
@@programmingchaos8957 Thank you for the advice, I tried changing the zoom values with other keys, but everytime I try to zoom out it doesn't work. It could also be for a my computer problem or maybe it's a bug with processing. I try to reinstall Processing and hope. Thanks for your time and help! 👍
@@Gentle_Ego Did you try printing the value of e in the zoom function? If e is positive it should be changing the position of the camera. I'm baffled.
@@programmingchaos8957 I have finally fixed it! The problem was that I didn't remember to put background(0) in the main code 😂😅. Tysm for the help and the availability
I've done that a few (i.e. many) times :)