I need help using peasy cam library

edited November 2017 in Library Questions

Hello, i'm developing an app in which i want a 3D object to be moved, i have this import peasy.*;

PeasyCam cam; PShape ammonite;

public void setup() { fullScreen(P3D); ammonite = loadShape("ammonite.obj"); cam = new PeasyCam(this, 100); cam.setWheelScale(0.01); // 1.0 by default cam.setMinimumDistance(60); cam.setMaximumDistance(500); } public void draw() { background(120, 120, 200); spotLight(255, 255, 255, 80, 20, 40, -1, 0, 0, PI/2, 2); directionalLight(255, 255, 255, width/2, height/2, 20); rotateX(-.2); rotateY(-.2); scale(20); shape(ammonite); pushMatrix(); translate(0, 0, 20); popMatrix(); }

and it works perfectly, but when I want to use that code in my application with background, the functions that I want to use on my 3D model, applies to all the app and it's a disaster, anyone has used that library using backgrounds and other objects?

How should I write the code in order to make it work?

This is a screen of the app that works

And this happens when I try to put that code on my app and I move the mouse

Thanks!

Answers

  • Edit post, highlight code, press Ctrl-o to format.

    You have a background. Do you mean a background image?

  • Answer ✓

    koogs, I found a solution, thanks for answering anyway!!

This discussion has been closed.