Author Topic: 2D Primitives  (Read 6227 times)

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
2D Primitives
« on: May 15, 2006, 01:18:41 am »
Hi, is ti posible to draw 2d primitives like Lines, circles, rectangles and things like that???? I need them for a homework and all my classmates are asking for a engine to do that.
Nada por ahora

Offline Mr.Marbles

  • int
  • **
  • Posts: 81
    • View Profile
2D Primitives
« Reply #1 on: May 15, 2006, 03:07:48 pm »
This is probably not the best way, but you can use Primitives.getPlane() to create an Object3D plane and use setTransparency() on it. Then apply a texture that would have a drawing of your 2D shape on it.

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: 2D Primitives
« Reply #2 on: May 15, 2006, 05:52:03 pm »
Quote from: "Melssj5"
Hi, is ti posible to draw 2d primitives like Lines, circles, rectangles and things like that???? I need them for a homework and all my classmates are asking for a engine to do that.

seems as java.awt.geom package is the engine you are looking for ;)

Quote
r a f t

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
2D Primitives
« Reply #3 on: May 15, 2006, 06:02:22 pm »
I need to work with 2d primitives but in OpenGl. Any possibilities to do it in jpct?
Nada por ahora

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
2D Primitives
« Reply #4 on: May 15, 2006, 07:28:58 pm »
i know almost nothing about open gl but i will most likely go after the Mr.Marbles' approach. java.awt.geom package can help to generate textures on the fly
Code: [Select]
r a f t

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12298
    • View Profile
    • http://www.jpct.net
2D Primitives
« Reply #5 on: May 15, 2006, 08:03:27 pm »
Generating textures on the fly to do this is suitable if it's all part of a 3d application. But if this is a 2d application, i don't recommend to use jPCT for this at all...it's a 3d engine, not a function plotter.

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
2D Primitives
« Reply #6 on: May 16, 2006, 05:14:41 am »
Ok, thanks. Anyway to draw just a point on a pixel?, I can manually draw the lines.
Nada por ahora