Author Topic: Divide Plane  (Read 4260 times)

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Divide Plane
« on: February 16, 2011, 10:59:37 pm »
Hello everybody,
I would like to know a way to divide my plan.
Is that when the user wants to move your character in the plane, he will click the character after that and asked where to direct the character. Similar to Dragon Mage project. I wanted to divide the plane so that when the mouse cursor passed over it a simple square changed color for the user to know where the character will.

Thanks in advance

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Divide Plane
« Reply #1 on: February 16, 2011, 11:27:26 pm »
1 - What is the best way to click on a 3D object and clicking the I plan to move the object to that place? I want my character to move anywhere in the plan by clicking somewhere in the plane.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Divide Plane
« Reply #2 on: February 17, 2011, 08:28:44 am »
It might be a better idea to simply use a kind of marker instead of modifying the plane itself. Concerning your second question: What you need here is picking. The wiki has a page about it or you can have a look at (for example) this thread: http://www.jpct.net/forum2/index.php/topic,1932.0.html

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Divide Plane
« Reply #3 on: February 17, 2011, 02:09:08 pm »
How i use this Marker?
thanks for the answer.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Divide Plane
« Reply #4 on: February 17, 2011, 02:26:52 pm »
Create another, smaller plane and place it where you want to...just get creative.

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Divide Plane
« Reply #5 on: February 17, 2011, 03:22:41 pm »
True. It Worked.

Olsen, I'm trying to make my character in the format MD2 get animated. I'm using the AdvancedExample snork. When my desktop application was able to animate it using the method of AdvancedExample animate well, but in the applet it does not get animated. He is already being shown usually along with other objects, but not animated.
You know why?

thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Divide Plane
« Reply #6 on: February 17, 2011, 03:23:59 pm »
Most likely because you did something wrong. Impossible to say without seeing any code.

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Divide Plane
« Reply #7 on: February 17, 2011, 03:25:46 pm »
Tradução do português para inglês
Oh, I call the method animate(ticks) in the run method of my applet.

public void run(){
        long ticks = 0;
        while (loop){
            this.repaint();
            
            try{
                Thread.sleep(10);
            }catch(Exception e){
                            }
            ticks = ticker.getTicks();
            if (ticks > 0) {
               animate(ticks);  
               move(ticks);
              
            }
        }
    }

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Divide Plane
« Reply #8 on: February 17, 2011, 03:26:57 pm »
public void animate(long ticks) {

      if (ticks > 0) {

         float ft = (float) ticks;
         ind += 0.02f * ft;
         if (ind > 1) {
            ind -= 1;
         }

         snork.animate(ind, 2);
}

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Divide Plane
« Reply #9 on: February 17, 2011, 03:29:21 pm »
I have tested animate(ticks) in my method public void paint( Graphics g ) but not worked too. =(

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Divide Plane
« Reply #10 on: February 17, 2011, 04:17:44 pm »
Olsen Thanks for the help.

I managed to animate the snork.
Trade the instructions:

snork.compileAndStrip();

for

snork.compile (true, false, true, false, 1000);


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Divide Plane
« Reply #11 on: February 17, 2011, 05:02:40 pm »
Yes, compile() or compileAndStrip() don't work for animated objects. But that can't be taken from the Advanced Example!?

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Divide Plane
« Reply #12 on: February 17, 2011, 06:57:36 pm »
Yes, but I changed that instruction in some tests and ended up not changing back. ^^" y