Hey, I’m looking for a source code to an applet that lets you change outfits on a 3-d model. How do I do have it so when you click on a certain costume, it puts that costume on the model. Is there anywhere with example and source code?
This is a pretty high-level request for source code.
You will need several things to do this.
-
The 3D content, i.e. the models. The character model and the “clothes” models if they are static.
-
If the clothes are meant to move, you will need a physics simulator for the cloth surface, as well as collision geometry for your character and the cloth itself.
-
If the clothes are static, then you just need to load the different models and use a Switch node or similiar along with some mouse click code or other UI to make the switch happen.
-
A Java3D content loader that supports loading whatever your model format is. Often this loader is really in combination with whatever software you are modeling in and the classes meant to manipulate the model in Java3D. It is the “glue” between the export content and the run-time interactivity.
Hope that gives you some more ideas!
Good luck!
Well, I have the 3-d model source code, I just need some info on the click and put on cloth part. I’m not sure how to do the action handler.
So are the clothes a set of static models? You’re not looking to put together any kind of cloth simulation?
Most likely static models to put on 3-d models. Its like a virtual try-on type of thing. I’ll work on rotating after I get it to work.
So you just need to load in the 3D models and then place the appropriate clothing at the same location as the model?
I think the way to do this uses SwitchGroups, but as I haven’t got that far on the vaguely similar project I’m working on, I can’t be a huge help beyond that, I’m afraid…
Putting clothing on beautiful avatars isn’t necessary.
They won’t catch cold.
“Picking” is the method of recieving mouse down events
on the model, I’ve done it with a Java3d Chess Player
that allows you to have the Chess Player Avatar
reach for, grasp, lift, and move the chess pieces for you,
and Selman has a nice demo in his Java3d book
using VRML & the Sun VRML Loaders.
Nasa has Java3d demos that allow adding elements
during run-time, and uses the VRML & the
___ Sun VRML Loaders ___ ( see below for both )
The " Fashion Show " demonstrates dressing & undressing
models, and having them walk as you command with Java,
in a browser, using the Shout3d.com / Eyematic Java 1.1
Engine ( not Java3d ) – see below, it’s the best demo I’ve seen !
Nasa uses Java3d & the Sun VRML Loaders
for Web animation in a browser and
demos show how you can add parts
( adding clothing would be possible )
as you can see here …
| Animate 3D models
|
| Rotating Earth Globe
|
| Easy Add Geometry
|
| Adding Parts …
|
| VRML using vrml97.jar
|
http://fastscript3d.jpl.nasa.gov/gallery.html
http://fastscript3d.jpl.nasa.gov/FS_MODEL/vrml-roverR.wrl
^— Mars Red Rover Robotic Explorer --v ( different VRML )
http://home.rochester.rr.com/javajava/Ani/ani_mars_robot_arm_java3d.gif
More VRML Models rendered with the Sun VRML Loaders:
http://fastscript3d.jpl.nasa.gov/FS_MODEL/
< block quote from Sun’s Java3d-interest list >
Load & Move VRML objects with Click Picking ( Chess Player )
http://www.frontiernet.net/~imaging/H-Anim_Avatars.html
- features Human animated & under your control,
you click on the chess board, he reaches,
lifts & moves chess pieces ( moving the __ picked object __
to different locations in the Scenegraph )
http://www.frontiernet.net/~imaging/sc_nasa_java3d_simple.jpg
^— Java3d Chess Player with You Picking the Moves --v
http://www.frontiernet.net/~imaging/terrain_rendering.html
http://www.frontiernet.net/~imaging/sourcecode/Human.java
http://web3dbooks.com/java3d/jumpstart/Human.html
Dress & Undress models on the fly: 3d “Fashion Show”
http://www.eyematic.com/Fashion/passport_piii_n.html
http://www.eyematic.com/Fashion/index.html
^-- human animation of seamless avatars with Java
Change 3d Furniture on the Fly ( Demo )
|
| Javascript makes it possible to add
| simple interaction between blaxxun3D and
| other elements on the HTML page.
|
| This document explains some of the enhancements
| that are possible by interfacing with blaxxun3D
| via Javascript. …
|
| Let’s have a look at the example below.
| Imagine a furniture scenario. You would like
| to present a table, which is available with
| different tops and legs. Instead of displaying
| each of the different tables in a separate image,
| you want to let the user decide the appearance
| of the table interactively.
|
| The two drop-down lists below the applet
| realize this functionality; the user can
| choose his favorite appearance. The javascript
| function ‘setTable’ receives the selected choices
| and updates the 3D model of the table. This is
| done by setting the whichChoice field of a
| switch node containing all possible appearances.
|
http://www.blaxxun.com/developer/blaxxun3d/jsInterfacing/index.html
|
http://www.blaxxun.com/developer/blaxxun3d/
Scripting with Java3d & Sun’s VRML Loaders by Nasa Staff
http://www.frontiernet.net/~imaging/terrain_rendering.html
|
http://www.frontiernet.net/~imaging/terrain_rendering.html#Nasa_using_Sun_VRML_Loaders
|
http://fastscript3d.jpl.nasa.gov/gallery.html
Sun’s Loaders allow you to load & render VRML
in a browser and it’s all done on the fly with
the full support of the modern object-oriented programming
language used in industry & academia: Java
Load & Animate VRML on the fly with Java3d w. Sun’s Loaders
http://www.frontiernet.net/~imaging/vrml_loaders_working.html
VRML, XML, & the Sun VRML Loaders are also used by the
___ Virtual “Lab3d” Chemistry Lab __ created in part
with ____ your money ___ by way of the NSF.
Virtual Chemistry Lab with VRML, Java3d, XML & the Sun Loaders
http://www.frontiernet.net/~imaging/virtual_chemistry_lab.html
The Sun VRML Loaders for Java3d allow control of the VRML
objects via Java EAI Scripting.
– Paul, Java Developer & Web Animator
Imaging the Imagined: Modeling with Math & a keyboard
< end block quote >
The ordering was changed, with permission of the author.
Note:
I’ve included both Java3d and 3d Java without Java3d
and I’ve done both, and done both with
___ the Same VRML Models ___
using the Sun VRML Loaders and
the Shout3d.com / Eyematic.com engine,
and have written my own from scratch
3d animation engines & VRML Viewers.
Don’t limit yourself to either,
Use what works best,
Try the Sun VRML Loaders.
The Sun VRML Loaders have worked well
for me, Nasa, the NSF Virtual “Lab3d” Chemistry Lab,
and just about everyone, except the guys
making the ‘new’ loaders at Yumetech.com, or so they claim.
– Paul, Java Developer & Web Animator
Imaging the Imagined: Modeling with Math & a Keyboard
Hello
Can i program 3D games with model that made by MAYA
and control with JAVA API ? ???
ThanQ 4 Ur HELP