Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

What is the data structure of a texture?

mesh 3d texture

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1 Chall

Chall

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 349 posts

Posted 15 May 2014 - 12:27 PM

I need to know how to build a texture object for a 3D model. Normal images (using java, will only use java) cannot achieve the level of manipulation required (in a timely fashion at least). I would guess it would start out as an image, convert it to bytes, and then manipulate the bytes.


Speaks fluent Java

#2 gregwarner

gregwarner

    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1586 posts

Posted 15 May 2014 - 01:37 PM

It would depend on which 3D engine you're using. There's a plethora of them out there, and each one I'm sure provides a slightly different data structure for dealing with textures. I'm only familiar with JMonkeyEngine, as it's the only 3D engine for Java that I've experimented with.

ti-99-sig.png
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#3 Chall

Chall

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 349 posts

Posted 15 May 2014 - 05:38 PM

It would depend on which 3D engine you're using. There's a plethora of them out there, and each one I'm sure provides a slightly different data structure for dealing with textures. I'm only familiar with JMonkeyEngine, as it's the only 3D engine for Java that I've experimented with.

Alright, thanks, I'll have a look.


Speaks fluent Java

#4 gregwarner

gregwarner

    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1586 posts

Posted 16 May 2014 - 06:22 AM

The main difference between storing images in Java and storing textures for a game is that the textures for a game will be most likely stored in graphics memory rather than system RAM. This is so the graphics card can much more quickly paint that texture to the screen.

 

Rather than go into detail here about how to get Java to store an image in the graphics RAM, I'll link you to two articles that I've used in the past for this topic. Each article takes a little different approach, but they should give you some good ideas to get you started.

 

http://www.javalobby...=16840&tstart=0

 

http://www.cokeandco...info/tut2d.html


ti-99-sig.png
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#5 Chall

Chall

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 349 posts

Posted 16 May 2014 - 06:52 AM

So, long story short, VolatileImages are stored in Graphics mem instead of regular RAM?
Speaks fluent Java

#6 gregwarner

gregwarner

    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1586 posts

Posted 16 May 2014 - 08:40 AM

Strictly speaking, VolatileImages are stored in non-standard memory, but if created in the manner demonstrated in that link above, yeah, that normally means in your graphics memory.


ti-99-sig.png
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download